events between form and subform

G

Guest

I have a form with a subform, and the form has two buttons, one to undo
changes on the form, another to undo changes on the subform. Both buttons
are on the main form because the subform is in datasheet view.

The two buttons work OK except in the following scenario: I'm in the
subform and my subform record is so messed up that I want to click the undo
button for the subform, which is on the main form. However the before update
event on the subform record finds a problem, and won't let me go to the
button. The users are accustomed to an undo button, and they don't want to
train them on the escape key.

Is there any event prior to the before update event where I can detect that
I'm going to the undo button on the main form, and therfore bypass the before
update event?
 
P

Pat Hartman\(MVP\)

No. Access attempts to save the subform record when you move focus from the
subform to the mainform. Your undo button MUST be on the subform. If you
want to leave the subform in datasheet view, you can add an unbound column
that just says "UNDO". Then in the click event of that field, you can put
your undo code.
 
G

Guest

Thanks - that did the trick!


Pat Hartman(MVP) said:
No. Access attempts to save the subform record when you move focus from the
subform to the mainform. Your undo button MUST be on the subform. If you
want to leave the subform in datasheet view, you can add an unbound column
that just says "UNDO". Then in the click event of that field, you can put
your undo code.
 
A

Albert D.Kallal

In addition to Pats comments, you can also build a custom menu bar and put
the un-do buttion there......
 

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