Run Save command from one Access form to another

I have a form (FormMain) and a subform (subformMain).  I am trying to execute a command while in FormMain but cannot get it to work until the data in subformMain is saved.  I can press a SAVE button in the subform and all works fine but I would like to automate this.  I would think it would be something like:

Form_FormMain.subformMain.runcmd save....   I know that is wrong but the concept is there.

Is there a way to run the save procedure from another form?

Thanks
marku24Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

etech0Commented:
Try this:
DoCmd.Save(acForm, "NameOfFormToSave")

Open in new window

0
marku24Author Commented:
it is telling me the form isn't open but it is open.  I need to save the record.  Would I use acForm to save the record as well?
0
etech0Commented:
If you just want to save the data, you can try this:

Form_FormMain.subformMain.subformMain.dirty = false

Open in new window

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

marku24Author Commented:
it doesn't recognize dirty as a property and generates an error.  Also, am I writing the sub form name twice as you have above?
0
marku24Author Commented:
got it... this works:   DoCmd.RunCommand acCmdSaveRecord
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marku24Author Commented:
This solution actually worked for me.  I posted it to help anyone searching.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.