OnRecordExit wha' happened?

  • Thread starter Thread starter Randy Hall
  • Start date Start date
R

Randy Hall

anybody know what happened to the OnRecordExit property and RecordExit?
just found reference it to it in Help and have been trying to trap some
errors at just such an event time but now can't find more on it. I've tried
putting in VB code but no luck. ?????????

i have a main form/subform setup with linked master/child fields.
need to trap whether fields on subform are null before user leaves current
main form record to go to another record. (i.e. PageUp, PageDown, mousewheel
roll up, acPrevious, etc)

my first approach was to put a test into main form's beforeupdate event but
that prevented user from actually entering the subform to enter data because
the main form's data is updated/saved when moving to subform. Caught in a
logic cycle that i can't seem to find a way out.

any suggestions are appreciated..

R. Hall
 
Hi Randy,

Those events were planned for Access2002 but they were removed before the
product was released. Unfortunately the help files did not get updated. Here
are some KB articles that might help you with a workaround.

ACC2002: RecordExit Event Unavailable in Microsoft Access 2002
http://support.microsoft.com/default.aspx?scid=kb;en-us;286477&Product=acc2002

ACC2002: RecordExit Event in Employees Form Does Not Work
http://support.microsoft.com/default.aspx?scid=kb;EN-US;286591

ACC2002: How to Programmatically Implement a RecordExit Event
http://support.microsoft.com/default.aspx?scid=kb;en-us;304139&Product=acc2002

For your situation, you might be able to use the Exit event of the subform
control and do your validation there. For this to work, the main form needs
to know when the subform has been dirtied - of course by the time control
returns to the mainform the dirty property of the subform is already false
because the update (if any) has already occurred. To get around this, just
create an unbound yes/no control on the subform which is set to true in the
Dirty Event of the subform's form. In the Exit event of the subform control
on the main form, check this boolean and run the validation code as
necessary and the reset the boolean back to false.
 
Back
Top