loading and saving many subforms from one control

  • Thread starter Thread starter JustMe
  • Start date Start date
J

JustMe

hi - i desperately need help. Can you make a button on a main form save
data on all other subforms on the tabs I have created? if so how?
 
The question does not really make sense to me.

Whenever you click in a subform, the main form record is saved before focus
moves into the subform. If you then click in another subform, the first
subform's record is saved before focus moves to the 2nd subform.

That means the only way you can get multiple subforms dirty at the same time
is to dirty them programmatically. If you are doing that, I suggest that you
force a save immediately after the programmatic change, e.g.:
With Me.[MySubform].Form
![SomeControl] = somevalue
.Dirty = False
End With

To answer your question, it would be possible to loop through the Controls
collection of the main form, and for each one test if the ControlType is
acSubform. If so, and it is bound (RowSource property is longer than zero),
then set its Dirty property to False.
 
Back
Top