adding records in subforms

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
ops...
it sounds so... easy...
.....now..

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

Thanks!
 
Back
Top