Resetting Control Background Colors after an Undo Event

  • Thread starter Thread starter Chris Windsor
  • Start date Start date
C

Chris Windsor

How would you do this:

You have a form that when loaded, the background colors of all the empty
controls (e.g. textboxes and comboboxes) are yellow (to alert the user that
they are empty). After entering data into a control, it turns white (this I
have working). Exercise an Undo event (e.g. pressing the Esc key), the
dirty controls should go back to their empty state and the background colors
change back to yellow. Everything I've tried leaves the background color of
the empty controls white.

Chris
 
In the form's Undo event, examine the OldValue of the control, e.g.:
Me.Text0.BackColor = IIf(IsNull(Me.Text0.OldValue), vbYellow, vbWhite)
 
Perfect... many thanks Allen

Chris

Allen Browne said:
In the form's Undo event, examine the OldValue of the control, e.g.:
Me.Text0.BackColor = IIf(IsNull(Me.Text0.OldValue), vbYellow, vbWhite)
 
Back
Top