Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leave Record Event?

Status
Not open for further replies.

jpearson

Programmer
Jun 20, 2001
2
0
0
US
Here is my situation. I have a form with a subform. I have code that I want to run whenever I leave the current record on the main form. In addition, this code needs to run only when the data on the subform has changed.

I have tried using a hidden checkbox on the main form that is linked to the on_dirty event of the subform. Then my code is placed on the after_update event of the main form. The problem with this is that the after_update event is triggered whenever I move between records on the subform in addition to whenever I move to another record on the main form.

Is there an undocumented leave record event in Access or some sort of workaround that will achieve the same thing?
 
Have you tried the BeforeUpdate event on the form. This allows you to perform verifications and cancel the updates if not verified.

Also, each control has an OldValue property which can be compared with the current value to determine if modifications were made.

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top