Event to trap navigation button click?

  • Thread starter Thread starter cmb
  • Start date Start date
C

cmb

Is there any way to trap a navigation button click before
moving to the next record? My form displays one record
at a time. I wish to perform a verification that
involves comparing the values of several fields on a
subform to values on the form itself. I need to run the
verification whether changes were made to any one or more
of these fields, and not until the user is trying to move
on to another record.
 
You can use the form BeforeUpdate event.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
I don't know if this will for sure work the way you need
it to but I think will a little code it should. When
ever a field is changed on a form their are 2
BeforeUpdate methods that will fire. One is the
BeforeUpdate for the field and the other is the
BeforeUpdate for the form. The 2nd one is the one you
want to pay attention to. This is where you can run
validation code and if validation fails just cancel the
Update and Undo the action and the form shouldn't
navigate to the next record. Hope this helps!
 
This only works if something on the form (not the
subform) is changed. I want to also be able to pick up
on changes made to the subform (sales detail)without
corresponding changes being made to the main form(money
received).
 
Back
Top