Cancel form navigation event

tuna

Registered User.
Local time
Today, 22:35
Joined
Mar 31, 2010
Messages
27
Hi, is there any way to cancel navigation to a different record?

I want to make sure that a subform has exactly one record before allowing the user to move away from the current record or close the form, and cancel the close/navigation if necessary. The close event was easy enough, but I can't find any events for changing records except for OnCurrent, but that is too late.

Microsoft documents a promising event called "RecordExit", but I can't seem to find it in the form property sheet in Access 2007.

Thanks
 
You could use the forms BeforeUpdate event of the form and the forms OnClose event of the form to test the record count of the subform and then cancel the event if the subforms record count = 0.

You could create and use custom navigation buttons then you can test the record count of the subform for each navigation button.
 

Users who are viewing this thread

Back
Top Bottom