When is a record saved?????

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I have a form that has 3 tabcontrols. 2 of the tab controls are based on
other linked tables. On the main form I have a command button that has code
which checks if the record is a new one and if so a message box appears.
This works fine if the user doesn't tab into the tab controls. However if
they do and they then click on the Save button the message doesn't appear.
Is this because the record is saved when the user tabs to the tab control
and so when they click on the save button it is already saved and therefore
not a new record? If so how can I change the code so that the message comes
up after they've tabbed to the tab controls AND they click on Save?
Hope I've explained that!!
TIA
Tony Williams
 
If you meant you have Subforms in the tab Pages of the TabControl then there
is the AutoSave feature of the Form/Subform combination in action.
Basically, if the Focus moves from the main Form to the Subform, the Record
on the main Form is automatically saved. If the Focus moves from a Subform
to the main Form (or another Subform), the Record on the Subform is also
saved.

So basically, the answer to your question is yes. Unfortunately, there is
no way you can disable the AutoSave feature unless you use unbound
Form/Subform or temporary Tables which is messy at best.

If the message is to ask whether the user wants to save the Record then it
is too late anyway.
 
Thanks Van I had a horrible feeling that was the answer!!!
Back to the drawing board
Tony
 
Back
Top