Sendkeys "^s" - Ctrl-S to save the app isn't working.
I need to get access to save layout changes made by a user to a subform.
I have a subform and some controls on the main form that alter the layout of the subform - some checkboxes that hide and unhide the columns.
I also have a button that exports the current contents of the subform to excel.
DoCmd.OutputTo acOutputForm, "MySubForm", acFormatXLS, OutputPath, AutoStart:=-1 (Very happy with how this works!)
The problem is that if the user hides or unhides columns using my checkboxes, these changes are not picked up by the export to Excel until the user saves the subform by closing the form.
So I need some code that forces changes made to the subform to be saved, without closing the subform.
DoCmd.Save acForm, "MySubForm" - doesn't work "RunTime Error 2489 - The object isn't open."
What DOES work is clicking the save button in the top left corner of the access application.
But I can't find any code that mimics this button.
Sendkeys "^s" for some reason doesn't do anything at all.
Can anyone provide code that mimics the main SAVE button in access, or code that will specifically force my subform to save layout changes as it would when closing?