Change Colour Of A Variable On A Form

ricky76
ricky76 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_VanDyck
    Luc_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)
  • Quasimodo
    Quasimodo Member Posts: 45
    Sorry Luc,

    but this does not work for variables.

    Michael
  • Quasimodo
    Quasimodo Member Posts: 45
    Sorry again,

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


    Michael
  • ricky76
    ricky76 Member Posts: 204
    Many thanks.