A
aft3rgl0w
I have a distribution table where we log CDs out. part of logging some of
these out requires a distribution report be sent with it. I have a form that
creates the distribution report, which includes the company name, contact,
the media numbers and quantities. there is a subform which lists which media
are being sent out, the number of copies and the description. here's what i
want to do: click a button, and have a record added to the distribution table
for each media. eg on form 2008-011, I have media numbers 1,2,3,4 going out.
in the distrbution table I want an entry for each 1, 2, 3 and 4. I have
some preliminary code but can't figure out how to cycle through the subform
media numbers. below is the code I have so far,
can anyone help with what i'm missing?
On Error GoTo Error_Add_Rec
Dim rs As dao.Recordset
Dim db As Database
Set db = CurrentDb()
Set rs = db.OpenRecordset("Distr1", dbOpenDynaset)
For Each d4 In (how do I refer to the numbers in the subform?)
With rs
.AddNew
!medianum = d4
!Name = attn
!Date = date_sent
!Tracking# = [tracking num]
![Media Copies] = xx (not sure how to get the qty from the
subtable)
.Update
End With
.Close
Next
rs.Close
Error_Add_Rec:
End Sub
these out requires a distribution report be sent with it. I have a form that
creates the distribution report, which includes the company name, contact,
the media numbers and quantities. there is a subform which lists which media
are being sent out, the number of copies and the description. here's what i
want to do: click a button, and have a record added to the distribution table
for each media. eg on form 2008-011, I have media numbers 1,2,3,4 going out.
in the distrbution table I want an entry for each 1, 2, 3 and 4. I have
some preliminary code but can't figure out how to cycle through the subform
media numbers. below is the code I have so far,
can anyone help with what i'm missing?
On Error GoTo Error_Add_Rec
Dim rs As dao.Recordset
Dim db As Database
Set db = CurrentDb()
Set rs = db.OpenRecordset("Distr1", dbOpenDynaset)
For Each d4 In (how do I refer to the numbers in the subform?)
With rs
.AddNew
!medianum = d4
!Name = attn
!Date = date_sent
!Tracking# = [tracking num]
![Media Copies] = xx (not sure how to get the qty from the
subtable)
.Update
End With
.Close
Next
rs.Close
Error_Add_Rec:
End Sub