G
Guest
I have placed a Control on the Main Form to Print an Invoice for the
displayed record. The "On Click" Event procedure is as follows:
Private Sub PRINT_INVOICE_Click()
On Error GoTo Err_PRINT_INVOICE_Click
Dim stDocName As String
Dim stCriteria As String
stDocName = "Invoice"
stCriteria = "Invoice Number =" & Me.Invoice_Number
DoCmd.OpenReport stDocName, acPreview, , stCriteria
Exit_PRINT_INVOICE_Click:
Exit Sub
"Invoice Number" is the Table's primary key field and is an Autonumber type.
The problem is that when I click on the control to print the displayed
record, i receive the following error:
"Syntax error (missing operator) in query expression '(Invoice Number = 1)'"
If I am on say record 2 (ie Invoice Number 2) the message is as above, but
refers to '(Invoice Number =2)'
Any help would be greatly appreciated to solve this problem
Thank You
displayed record. The "On Click" Event procedure is as follows:
Private Sub PRINT_INVOICE_Click()
On Error GoTo Err_PRINT_INVOICE_Click
Dim stDocName As String
Dim stCriteria As String
stDocName = "Invoice"
stCriteria = "Invoice Number =" & Me.Invoice_Number
DoCmd.OpenReport stDocName, acPreview, , stCriteria
Exit_PRINT_INVOICE_Click:
Exit Sub
"Invoice Number" is the Table's primary key field and is an Autonumber type.
The problem is that when I click on the control to print the displayed
record, i receive the following error:
"Syntax error (missing operator) in query expression '(Invoice Number = 1)'"
If I am on say record 2 (ie Invoice Number 2) the message is as above, but
refers to '(Invoice Number =2)'
Any help would be greatly appreciated to solve this problem
Thank You