- Aug 31, 2001
- 35,560
- 22
- 81
What I am trying to do is filter a report using criteria set in a form based on the data input in the database. I've got my form, filters, etc set, but for some reason the attached code does not work.
Private Sub Set_Filter_Click()
Any ideas as to why I keept getting an error on the strSQL = command?
Private Sub Set_Filter_Click()
Code:
Dim strSQL As String, intCounter As Integer
For intCounter = 1 To 4
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
strSQL = Left(strSQL, (Len(strSQL) - 5))
Reports![date_report].Filter = strSQL
Reports![date_report].FilterOn = True
End If
End Sub
Any ideas as to why I keept getting an error on the strSQL = command?
Last edited:
