loading and saving many subforms from one control

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?
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top