How to filter report from pop-up form error

  • Thread starter Thread starter Carol
  • Start date Start date
C

Carol

I keep getting the following error (depending on which
filter I choose).

Syntax error in string in query expression
'([Seasons]= "Spring)'

I tried to duplicate the Knowledge Base Article #208529,
but with 6 filter instead of 5.
 
Notice how there is NOT a closing double quote after the word Spring? That
needs to be resolved.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Thank you for your help. I thought that was what was
wrong except that I can't figure out where in the code
that the missing double quote should be. I have included
the entire code for your help.

Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer

'Build SQL String
For intCounter = 1 To 6
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " &
" = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
End If
Next

If strSQL <> "" Then
'Strip Last " And ".
strSQL = Left(strSQL, (Len(strSQL) - 6))

'Set the Filter property.
Reports![Titles by Selection].Filter = strSQL
Reports![Titles by Selection].FilterOn = True
Else
Reports![Titles by Selection].FilterOn = False
End If
End Sub
-----Original Message-----
Notice how there is NOT a closing double quote after the word Spring? That
needs to be resolved.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Carol said:
I keep getting the following error (depending on which
filter I choose).

Syntax error in string in query expression
'([Seasons]= "Spring)'

I tried to duplicate the Knowledge Base Article #208529,
but with 6 filter instead of 5.


.
 
Back
Top