K
Keith
I added a Print Preview button with the wizard and modified it so that it
would only print the report for the record I was on, but I am having
problems.
My code is below.
The field containing the unique value of the record is
would only print the report for the record I was on, but I am having
problems.
My code is below.
The field containing the unique value of the record is
Code:
and the first
record in the database (for example) contains the value A001 in this field.
However, when I click Print Preview, it asks for a parameter for A001 and I
have to enter the code I want to view the report for.
Why would this be?
Private Sub cmdPrintPreview_Click()
On Error GoTo Err_cmdPrintPreview_Click
Dim stDocName As String
stDocName = "Main Report"
DoCmd.OpenReport stDocName, acViewPreview, , "[Code] = " & Me![Code]
Exit_cmdPrintPreview_Click:
Exit Sub
Err_cmdPrintPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPrintPreview_Click
End Sub