changing control formating if it's value changed in form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ccoldfire
    New Member
    • Feb 2016
    • 3

    changing control formating if it's value changed in form

    hi to you all
    am trying make the control formatting changes when changing it's value to keep track of what controls i've changed in the form,wither it was a combobox or textbox .
    i had this idea of making the control checks the value in the table's field which is bounded to,so if they are not equal,so i tried Conditional Formatting using the "not equal to" and point it to the field in the table which is the control is bounded to , didn't work,and in the expression mode typing "<>" with the same previous pointing,got the same result
    any other ideas ?
    thank you
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    That's a good idea, but can't work as you have nothing to compare the value with. VBA gives you access to the .OldValue, but Conditional Formatting is not run in VBA.

    What you may be able to get working is some code in the AfterUpdate event procedures of all controls that compare the .Value with the .OldValue and set the background colour accordingly.

    Comment

    • ccoldfire
      New Member
      • Feb 2016
      • 3

      #3
      That exactly what i did,thank you

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        It was a pleasure and I'm very pleased you were able to work with it.

        I would recommend that each event procedure calls a (single) separate procedure that does the main work, and that this has a parameter indicating which control has been updated. Far tidier than loads of copies of the same code.

        Comment

        Working...