Link to home
Start Free TrialLog in
Avatar of commix
commix

asked on

Subform Event that recognizes record change

I have a form with subform.  I need to run a validation routine each time the user changes between records on the subform.  I've tried the On Lost Focus event and the Before Update event, but both seem only to run after you change something in the record on the subform.  In the Microsoft articles they talk about a RecordExit event, but I can't locate this event on the event property sheet.  Is there any event that will always be triggered when you change records?  
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

The On Current Event.

mx
Turns out the RecordExit  event - as I recall - IS mentioned in the documentation, but .. it apparently was never implemented.

mx
Avatar of commix
commix

ASKER

The on Current event seems to run when you enter the record, generating warnings to the user related to fields which have not yet been filled in the user.  I'm looking for an event which only runs when you "leave" the record.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America 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
Avatar of commix

ASKER

I currently use the Before Update event.  The validation routine for instance finds a mistake, asks the user to correct it and sets the focus to the control which needs to be corrected.  If the user does not do anything but tries again to move the focus to another record, the Before Update event will not be triggered again as there were no changes at all.  
"he Before Update event will not be triggered again as there were no changes at all.  "

Not the case.  As long as the record remains 'Dirty' ... the before update will continue to trigger ... unless something VERY unusual is happening.

mx