P
PHisaw
I have an unbound form with several combo boxes for report criteria. In the
OnClick event of CboReportName (lists report names to choose from) I have the
following code:
Private Sub CboReportName_Click()
Dim stWhere As String
Dim stDoc As String
stDoc = Me.CboReportName
If Not IsNull(Me.CboSlsp) Then
stWhere = stWhere & "And [Salesman]= " & Me.CboSlsp & """"
End If
DoCmd.OpenReport stDoc, acViewPreview, , stWhere
End Sub
I have only listed one because I can't get past the first combo box. It
gives the error message "3075 Syntax error (missing operator) in query
expression '(And[Salesman]=John Doe")'.
Any help with this would be greatly appreciated.
Thanks in advance,
Phisaw
OnClick event of CboReportName (lists report names to choose from) I have the
following code:
Private Sub CboReportName_Click()
Dim stWhere As String
Dim stDoc As String
stDoc = Me.CboReportName
If Not IsNull(Me.CboSlsp) Then
stWhere = stWhere & "And [Salesman]= " & Me.CboSlsp & """"
End If
DoCmd.OpenReport stDoc, acViewPreview, , stWhere
End Sub
I have only listed one because I can't get past the first combo box. It
gives the error message "3075 Syntax error (missing operator) in query
expression '(And[Salesman]=John Doe")'.
Any help with this would be greatly appreciated.
Thanks in advance,
Phisaw