Proper Event - Leaving Record?

R

Renraf

I have a form that performs a validation procedure on the event BeforeUpdate:
StpStrtDiff = IntSum + ActvtSum. If the values do not match, it asks the user
to correct their data. However, IntSum pulls a sum from a subform, causing
two problems:

1) If the user updates data in the subform but not in the parent form, the
validation will not run, even though the criteria may no longer be met.
2) If the validation fails, and the incorrect data is in the subform, the
user cannot navigate to the subform without retriggering the validation,
preventing them from being able to correct the data.

What event can I use that will fix this problem? Ideally, I don't want the
validation to be running until the user clicks to go to the next record in
the parent form or closes out of the form.
 
D

David H

What's the purpose of ActvtSum?

Also you can explicity set the forms .Dirty event to True which effectively
tells Access to consider the record displayed as updated.
 
R

Renraf

ActvtSum is the sum of work order-driven time in the parent form and IntSum
is the sume of non-work-order-driven time in the subform. Together, they need
to add up to the difference between start and stop time.

I really just need to know if there is any Event I can use that equates to
moving to a different record on the parent form. As long as that same record
is displaying on the parent, I don't want this validation to occur because
they could be changing relevant info in the subform. I'm fine if the record
updates in the interim; I just don't want the user to be able to move
on/close the book on that record until it is correct.
 
R

Renraf

I am so annoyed that the RecordExit event was removed from Access before
release, even though it is still described here:
http://office.microsoft.com/en-us/access/HP051867611033.aspx

That was exactly what I was looking for. Instead, I will have to make custom
navigation buttons with built-in validation because--correct me if I'm
wrong--BeforeUpdate or AfterUpdate will only trigger when the parent form has
been updated while OnCurrent will trigger an additional time before and any
information has been entered. I guess I will try OnCurrent and see what
happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top