jazminecat23
Programmer
Hi all - I have a form with a simple print button on it. I want the button to open my report only with the current record. here's my code:
Can anyone see what I might be missing? VENDOR_NUM is a textbox, and the form is set to view a single record at a time. Thanks in advance for your help!
Code:
Private Sub PrintRecord_Click()
On Error GoTo Err_PrintRecord_Click
Dim stDocName As String
stDocName = "VendorRequestReport"
DoCmd.OpenReport stDocName, acViewPreview, , "VENDOR_NUM=" & Me.VENDOR_NUM
Exit_PrintRecord_Click:
Exit Sub
Err_PrintRecord_Click:
MsgBox Err.Description
Resume Exit_PrintRecord_Click
End Sub
Can anyone see what I might be missing? VENDOR_NUM is a textbox, and the form is set to view a single record at a time. Thanks in advance for your help!