Question : How does this really work   -   DoCmd.DoMenuItem A_FORMBAR, A_FILEMENU, A_SAVERECORD

We have a form frmA (main form) and several (linked) subforms are on frmA.    These are Access forms attached to MS SQL tables not Access tables.

Quesion - When frmA, via VBA code, executes the following command,

   DoCmd.DoMenuItem A_FORMBAR, A_FILEMENU, A_SAVERECORD

is the save record only applicable to frmA, or does it cascade through and cause all subforms to save their records as well?

If Yes to cascading, what forms/records are saved first  what is the order of saving records?

Answer : How does this really work   -   DoCmd.DoMenuItem A_FORMBAR, A_FILEMENU, A_SAVERECORD

The alternative is as I posted:

Me.Dirty = False     ' ** save the record

As far as the subforms. you really should not have to worry about that when you are on the main form - the subform data would not be in a state that needs to be saved at that moment.  Typically in a continuous or datasheet subform, data is saved as soon as you click off the subform or into another row.

mx
Random Solutions  
 
programming4us programming4us