Form with Sub Form Question

G

Guest

I have code in my main form BeforeUpdate Event that asks the user if they
want to save their changes (and if they don't, I undo the changes before
closing the form).

I recently added a sub form. If the user clicks on one of the fields on the
sub form to edit it, the main form BeforeUpdate event is triggered and they
are asked if they want to save their changes--which is bad timing for that
question.

Any suggestions on how to give the user the choice of saving their changes
at a more appropriate time (not when they click on the subform)?

Thank you,
Judy
 
R

Rick Brandt

Judy said:
I have code in my main form BeforeUpdate Event that asks the user if
they want to save their changes (and if they don't, I undo the
changes before closing the form).

I recently added a sub form. If the user clicks on one of the fields
on the sub form to edit it, the main form BeforeUpdate event is
triggered and they are asked if they want to save their
changes--which is bad timing for that question.

Any suggestions on how to give the user the choice of saving their
changes at a more appropriate time (not when they click on the
subform)?

Thank you,
Judy

Can't be done without binding to work tables. (bad idea anyway). Why would a
user go to the trouble of filling out a form and then NOT want to save it?
You're looking for the solution to a non-existent problem.
 
G

Guest

Thank you for responding.

Haven't you ever had the experience where you didn't mean to click on
something and weren't entirely sure if something had changed? In a Word or
Excel document you can just exit without saving your changes.

This form goes through several states and will be opened by more than one
user. I wanted to handle the scenario I described above by giving the user
the opportunity to close the form without saving any changes. From what you
are saying, this isn't possible.

Thank you,
Judy
 
R

Rick Brandt

Judy said:
Thank you for responding.

Haven't you ever had the experience where you didn't mean to click on
something and weren't entirely sure if something had changed? In a
Word or Excel document you can just exit without saving your changes.

And in Access you can just press <escape>. Pressing once undoes the changes
in the current control. Pressing twice in a row undoes all the changes to
the current form.

You can also lock the entire form by default and only allow changes when
they press an [Edit] button. That should eliminate the possibility of
"accidental" changes.
This form goes through several states and will be opened by more than
one user. I wanted to handle the scenario I described above by
giving the user the opportunity to close the form without saving any
changes. From what you are saying, this isn't possible.

It is only possible in a form/subform scenario if you bind your forms to
"work" tables and only copy the changes to the real tables after the user
has confirmed them. A LOT of extra work for dubious benefit in my opinion.
 

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