Change Colour Of A Variable On A Form

ricky76ricky76 Member Posts: 204
I have a form that after it gets the record it goes and pulls in a value from elsewhere and populates a variable. Is there any way to change the colour of this variable depending on conditions or can this only be done with records showing on the form?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can add this code to the OnFormat-trigger of your control:
    IF decMyVar < 0 THEN
      CurrForm.txbMyVar.UPDATEFORECOLOR(255);
    
    First, you have to give your control a name, using the Name-property!
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • QuasimodoQuasimodo Member Posts: 45
    Sorry Luc,

    but this does not work for variables.

    Michael
  • QuasimodoQuasimodo Member Posts: 45
    Sorry again,

    it works, I did not pay attention that you have to give a name to the variable.


    Michael
  • ricky76ricky76 Member Posts: 204
    Many thanks.
Sign In or Register to comment.