Full Version: Identify Value Before Change To Verify If Change Should Occur
UtterAccess Forums > Microsoft® Access > Access Forms
petite39
I have an address field that I need to check to see if there was a value in it when the form opens up to a customer name and if that field is changed to verify that change is allowed. Because if they change it it could possilbly be the wrong customer since there are so many customers with the same name but multiple sites. So if they change it they change the history of the account too.
tried the on-change event to pop up a message but that message pops up with every keystroke.
Jeff B.
OnChange happens after each keystroke. If you want to check after they leave the control, AfterUpdate (or OnExit) might work better.
... and if your "history" is important, consider using date/time fields to record "from" and "to" dates during which the address is valid...)
petite39
How would you know if the field was empty before the after update event? Because if it was blank then there's no need to do the check.
Jeff B.
If you're working on the form, and the control is bound to an underlying field in a table, I believe you can use the .OldValue property to test whether what's (now) in the control is the same as what was in the control.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.