M
macneil via AccessMonster.com
I am trying to print only the current record with the following code and I
get 2 copy of the same report everytime I print and I also get an error
message.
Private Sub Command59_Click()
On Error GoTo Err_Command59_Click
Dim stDocName As String
stDocName = "rptDocSub"
DoCmd.OpenReport stDocName, acNormal
DoCmd.OpenReport "rptDocSub", acNormal
Reports![rptDocSub].Filter = "Primary ID = " & Me![Primary ID]
Reports![rptDocSub].FilterOn = True
DoCmd.PrintOut acSelection
Exit_Command59_Click:
Exit Sub
Err_Command59_Click:
MsgBox Err.Description
Resume Exit_Command59_Click
End Sub
After I click the button the code runs and prints the 2 copies and then I get
this message
'The report name 'rptDocSub' you entered is misspelled or refers to a report
that isn't open or doesn't exist'
Can someone show me what I am doing wrong?
get 2 copy of the same report everytime I print and I also get an error
message.
Private Sub Command59_Click()
On Error GoTo Err_Command59_Click
Dim stDocName As String
stDocName = "rptDocSub"
DoCmd.OpenReport stDocName, acNormal
DoCmd.OpenReport "rptDocSub", acNormal
Reports![rptDocSub].Filter = "Primary ID = " & Me![Primary ID]
Reports![rptDocSub].FilterOn = True
DoCmd.PrintOut acSelection
Exit_Command59_Click:
Exit Sub
Err_Command59_Click:
MsgBox Err.Description
Resume Exit_Command59_Click
End Sub
After I click the button the code runs and prints the 2 copies and then I get
this message
'The report name 'rptDocSub' you entered is misspelled or refers to a report
that isn't open or doesn't exist'
Can someone show me what I am doing wrong?