rick roberts
Registered User.
- Local time
- Today, 19:48
- Joined
- Jan 22, 2003
- Messages
- 160
I have a main form called frmCustomer and a button that opens a second form called frmOutstanding3. While the second form is open over the first I have a button that prints a report (rptLetter3) for all records in the second form. However the code seems to be choosing records from the underlying form (frmCustomer). If I try the procedure with the first form closed l get a message box asking for the frmCustomer.ID.
Any ideas about whats going wrong please?
Option Compare Database
Dim rs As DAO.Recordset
Private Sub Command13_Click()
Dim stDocName As String
Set rs = Me.Form.RecordsetClone
While Not rs.EOF
stDocName = "rptLetter3"
DoCmd.OpenReport stDocName, acViewPreview, "ID = " & Me.ID
DoCmd.OpenReport "rptLetter3", acViewPreview
rs.Edit
rs!CheckLetter1 = True
rs.Update
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
End Sub
Any ideas about whats going wrong please?