Tony
asked on
Detect form data changes.
Detect Changes.
Hi,
I have a form in MS-ACCESS. When load the data, a check control = Yes (-1).
I want that the check control changes to No (0) as soon as any change in the form is detected.
How can I detect any change in the form and assign the "No (0)" value to the check control?
Hi,
I have a form in MS-ACCESS. When load the data, a check control = Yes (-1).
I want that the check control changes to No (0) as soon as any change in the form is detected.
How can I detect any change in the form and assign the "No (0)" value to the check control?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No reason to write any code. Just assign the form's Dirty property to the checkbox's ControlSource:
=[Dirty]
The problem with using the Dirty event is that I don't think you can track whether changes have been undone with that. On the other hand, using the form.Dirty property will always tell you whether the form is dirty or not.
ASKER
Good. Thank you very much.
Instead, just look at the forms dirty property which will tell you exactly the same information.
If you want code to run before saving, then use the forms before_update event. It will run any time a record is inserted or updated.