Capturing the old value of a field

  • Thread starter Thread starter Cathy
  • Start date Start date
C

Cathy

I have a status text box field that I want to maintain with check boxes. One
of the check boxes is "Void". If it's clicked, the status field should
change to "Void". My problem is that if they uncheck the box, I would like
the field to return to it's value prior to "Void". How do I retain that
prior value and use it only if the check box is unchecked?

Thank you,
 
There are various ways to do this.
The OldValue property retains the original value of the control until the
record is updated. So as long as the action occurs before the record is
updated, you could use this in the After Update event of the check box:

If Me.chkVoid Then
Me.txtStatus = "Void"
Else
Me.txtStatus = Me.txtStatus.OldValue
End If
 
Back
Top