Capturing the old value of a field

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,
 
K

Klatuu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top