Sub-Forms data not saving

ted.martin

Registered User.
Local time
Today, 16:14
Joined
Sep 24, 2004
Messages
743
I have a Main form with a Tab Control with a number of bound Sub Forms, each on several tabs.

I create a New Record on the Main Form and then move to another tab and then add data to a subform on a tab on what will of course be a New Record.

Despite using the Docmd.RunCommand accmdsaverecord line, I find that I cannot run a report from this new data unless the Main form is closed.

Essentially, the sub-form data is not creating a new record in its table until the Main form is closed.

Does anyone know why this is? I have even tried to force a Save by setting the subform to Dirty before the Docmd.RunCommand.accmdsaverecord on the subform.

It seems that I have to close the Main Form for the subform new record to be saved to the table.

If it helps, I am using a Custom Ribbon UI although I cannot imagine what this would have to do with it.

Thanks
 
Last edited:
Perhaps because there is no such command, unless you are showing a typo?
 
Besides, forcing a save normally requires setting

Myform.dirty=false
 
Code:
  DoCmd.RunCommand acCmdSaveRecord

Tried the code
Code:
 Me.Dirty = False
without success

I am now thinking I need to go to another new record to get the previous one to save but enter now data into the new one.
 
What is supposed to trigger the saves? Pressing a button launching a report does not cause a save by itself. Where is the save code?
 
Btw: note what a total waste of time it is to supply typos in the posts: it always introduces the possibility that the author messed up the code as numero uno
 

Users who are viewing this thread

Back
Top Bottom