Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Report Syntax Error

Status
Not open for further replies.

lexi0088

Technical User
Sep 7, 2004
49
I have the following code that keeps giving me syntax error (missing operator) in query expression "[CBNumber]= 79CB". I am running Access 2007.

Private Sub Command34_Click()
On Error GoTo Err_Command34_Click

Dim strDocName As String
Dim strWhere As String

strDocName = "Chargeback"
strWhere = "[CBNumber]= " & Me!CBNumber
DoCmd.OpenReport strDocName, acPreview, , strWhere, acWindowNormal

Exit_Command34_Click:
Exit Sub

Err_Command34_Click:
MsgBox Err.Description
Resume Exit_Command34_Click

End Sub

Please help!!
 
Code:
strWhere = "[CBNumber]=[!]'[/!]" & Me!CBNumber [!]& "'"[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV, YOU ARE AWESOME!!! Thank you so much, I must have tried every combination but that yesterday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top