Link to home
Start Free TrialLog in
Avatar of Tony
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?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The question is, why do you need this control?
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.

No reason to write any code. Just assign the form's Dirty property to the checkbox's ControlSource:


=[Dirty]

Open in new window

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.

Avatar of Tony
Tony

ASKER

Good. Thank  you very much.