cacorley
01-13-2010, 08:08 AM
I would like to print a report of a specific record from a form and am using the procedure below. But I get the following error "Run-time error 3075. Syntax error (missing operator) in query expression 'Order_No = 010510-02CC'". Am I missing something here?
Private Sub cmdPrint_Click()
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "There are no data for this record. Please select another record."
Else
DoCmd.OpenReport "Order", acViewPreview, , _
"Order_No = " & Me!Order_No
End If
End Sub
Private Sub cmdPrint_Click()
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "There are no data for this record. Please select another record."
Else
DoCmd.OpenReport "Order", acViewPreview, , _
"Order_No = " & Me!Order_No
End If
End Sub