adding records in subforms

G

Guest

This is something i have already posted twice, but without receiving reply.
I have an unbound form with a tab control on it. The tab control has 6 pages. On each page there is a subform.
The main (unbound form) has in the header a command button named "add new". I would like that by clicking the "add new" command button each subform goes to a new record, saving data entered trough them.
I dont' know how to make this possible trough code.
Thanks,
Rocco
 
K

Ken Snell

Something like this:

Private Sub cmdButtonName_Click()
Me.Subform1.Form.Recordset.AddNew
Me.Subform2.Form.Recordset.AddNew
Me.Subform3.Form.Recordset.AddNew
Me.Subform4.Form.Recordset.AddNew
Me.Subform5.Form.Recordset.AddNew
Me.Subform6.Form.Recordset.AddNew
End Sub

Note that the Subform1, etc. names need to be replaced with the actual names
of the subform controls (the controls that hold the subforms).

--
Ken Snell
<MS ACCESS MVP>

rocco said:
This is something i have already posted twice, but without receiving reply.
I have an unbound form with a tab control on it. The tab control has 6
pages. On each page there is a subform.
The main (unbound form) has in the header a command button named "add
new". I would like that by clicking the "add new" command button each
subform goes to a new record, saving data entered trough them.
 
G

Guest

ops...
it sounds so... easy...
.....now..

(have to say i have lost something like 2 weeks on this issue: should I change work?).

Thanks!
 

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