events between form and subform

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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.
 
In addition to Pats comments, you can also build a custom menu bar and put
the un-do buttion there......
 
Back
Top