G
Guest
I have the following message when clicking on a command button designed to
print a report based on the current record in a tabbed form.
Syntax error (missing operator) in query expression '(MachNumber=2G-CH01)'.
The following code is on the "click" event of the button:
Private Sub MachTag_Click()
DoCmd.OpenReport "M-Equipment Tag", acPreview, , "MachNumber = " &
Me!MachNumber
End Sub
The 1st tab of the form is pulling the MachNumber data directly from the
table. The 2nd tab form (is a subform) and is pulling the data from a second
table.
I do not have any query associated with either form.
When I remove the ", , "MachNumber = " & Me!MachNumber" from the code I am
able to preview the entire report, but want I want to do is print the report
for the current record shown on the 1st tab form.
Thank You,
print a report based on the current record in a tabbed form.
Syntax error (missing operator) in query expression '(MachNumber=2G-CH01)'.
The following code is on the "click" event of the button:
Private Sub MachTag_Click()
DoCmd.OpenReport "M-Equipment Tag", acPreview, , "MachNumber = " &
Me!MachNumber
End Sub
The 1st tab of the form is pulling the MachNumber data directly from the
table. The 2nd tab form (is a subform) and is pulling the data from a second
table.
I do not have any query associated with either form.
When I remove the ", , "MachNumber = " & Me!MachNumber" from the code I am
able to preview the entire report, but want I want to do is print the report
for the current record shown on the 1st tab form.
Thank You,