Don't know if it can be done.....

simongallop

Registered User.
Local time
Today, 16:22
Joined
Oct 17, 2000
Messages
611
I am trying to find an easy way to see if data in a textbox has been changed when it loses focus.
1 Is there a compare command or;
2 Is there a way in which I can assign the contents to a variable and then check that variable against the 'new' contents or;
3 Will I have to dump the original data into a spare textbox/label using On Got Focus and then test it with On Lost Focus?

Any help appreciated

Thanks in advance

Simon
 
hi,
I think that if you move off a control and the data has changed, Before- and AfterUpdate fire whereas if the data hasn't changed, they don't. I think this works for unbound controls as well as bound ones but not sure
yours,
mike
 
Search help for the OldValue property. You can do a comparison similar to this:

If Me![txtboxName].OldValue <> Me![txtboxName].Value Then
MsgBox "The Data has changed."
End if
 
Doh! That is a much easier solution than I have employed.

I have always used the Current Event to store the value in a variable, and then compare it to the new value.

I'm going to try that.
 
Jack, thanks for the pointer, but what I forgot to say was that the textboxes are unbound. Mike, you are right that afterupdate works for unbound controls.

Thanks guys for replying and making my life easier!!

Merry Xmas etc.

Simon
 

Users who are viewing this thread

Back
Top Bottom