Capture Current Values

X

Xero_inc

I have a form displaying data from a table. I would like to capture the
current data in some variables before the user is allowed to make any changes
on the form. Once the user makes changes, I would like to compare the current
values to old values stored in variable and accordingly update/insert records
in another table.

Please reply only if you can provide some code snippets.

Thanks,
 
A

Arvin Meyer [MVP]

If Me.txtWhatever = Me.txtWhatever.OldValue Then
'DoSomething
End If

The OldValue property on a bound control is the value you are looking to
compare. If you need to maintain that value farther than the current
subroutine, create a public form level variable to hold it.
 
Top