Subform saves

  • Thread starter Thread starter Someone
  • Start date Start date
S

Someone

Hello

I have a form which uses a three-page tab control. The form's record source
is a table, which the default (page 1) tab uses. Page 2 has a subform in
form view and its record source is a query to a table related to the main
table. Page 3 also has a subform (although in datasheet view) and its
record source is also a query to a (different) table related to the main
table.

I have a cancel button whose aim is to allow the user to discard changes
made. If changes are made to the main tab and the user flicks over to tab
three then decides to close, the changes are discarded as required.
However, if the user flicks to page two, the changes are saved and the
cancel button has no effect. I do not understand why this is.

Can anyone shed light on why this happens, please?

Thanks
M
 
Someone said:
Hello

I have a form which uses a three-page tab control. The form's record
source is a table, which the default (page 1) tab uses. Page 2 has a
subform in form view and its record source is a query to a table
related to the main table. Page 3 also has a subform (although in
datasheet view) and its record source is also a query to a
(different) table related to the main table.

I have a cancel button whose aim is to allow the user to discard
changes made. If changes are made to the main tab and the user
flicks over to tab three then decides to close, the changes are
discarded as required. However, if the user flicks to page two, the
changes are saved and the cancel button has no effect. I do not
understand why this is.
Can anyone shed light on why this happens, please?

Thanks
M

When focus moves from a form to a subform or from one subform to another subform
or forom a subform to the parent form Access always saves the record in the form
that is losing focus. If your TabPage has nothing on it but the subform then
going to that page will likely put focus into the subform thus saving the main
record.

Cancel buttons on forms with subforms are an excercise in futility. Educate
your users that changes are saved automatically and that if they don't want to
make changes then DON'T make any.
 
hi,
I have a cancel button whose aim is to allow the user to discard changes
made. If changes are made to the main tab and the user flicks over to tab
three then decides to close, the changes are discarded as required.
However, if the user flicks to page two, the changes are saved and the
cancel button has no effect. I do not understand why this is.
Access saves data automatically, if a (sub)form is losing the focus and
it is dirty.


mfG
--> stefan <--
 
Rick Brandt said:
When focus moves from a form to a subform or from one subform to another
subform or forom a subform to the parent form Access always saves the
record in the form that is losing focus. If your TabPage has nothing on
it but the subform then going to that page will likely put focus into the
subform thus saving the main record.

Cancel buttons on forms with subforms are an excercise in futility.
Educate your users that changes are saved automatically and that if they
don't want to make changes then DON'T make any.
I wondered why the save didn't happen when going to the third tab. The
subform on page 2 was the first item in the tab order, hence why the save
happened immediately.

I understand what you say about cancel buttons. I just wished their was a
straightforward cancel function!

Thanks
M
 
Back
Top