save button for both form and its subform

7anthala

Registered User.
Local time
Today, 04:16
Joined
Apr 7, 2014
Messages
41
i have a form with subform in it, and when i press the save button in the main form it saves only the records in it but it wont save the records in the subform

i found on microsoft this code
DoCmd.Save acForm, "New Employees Form"

how can i use it to save both the main form and subform together
 
As the sub form is part of the form, won't the sub form be saved when the form is saved.

Did you try it?
 
... saves only the records in it...

i found on microsoft this code
DoCmd.Save acForm, "New Employees Form"
...
The code is used for saving forms, not for saving records/data.
If the form and subform are bound, to table or query then the data is automatically saved.
 
Thanks for the clarification/correction. I incorrectly read it as docmd.save

Docmd.saveform is a construct I've never used before. I have not had occasion for a user to need to save a form in code - in fact I don't want them to change forms. That's not to say it will not happen in the future.
 

Users who are viewing this thread

Back
Top Bottom