David wrote:
Hi
I want to be able to set a variable on the 'on got focus' event and use
that value in the 'on lost focus' event. This is because the on click event
enters a date into a field and I want to record what the old date was.
Is this possible or do I have to think along the lines of populating a
field in a temp table? I have to repeat this for other button objects on the
form.
Thanks in advance
Dave
As Lyle said, you can get the OldValue ex: Me.Text0.OldValue
If Me.Text0 <> Me.Text0.OldValue
I think this only works with bound variables.
You can also enter something at the top of the form's code module to
declare the value. The form module may look something like this
Option Compare Database
Option Explicit
Dim varStorageVariable 'declares the variable globally for the form
Sub A
varStorageVariable = "David"
msgbox varStorageVariable
End Sub
Sub B
varStorageVariable = "Roebuck"
msgbox varStorageVariable
End Sub
Sub C
A 'call the routine
B 'call the routine
End Sub