L
Liz
I have a popup form that filters fields in for a report,
the user chooses the appropriate info from a combo box and
clicks a Filter button to perform the actual filter. This
works perfectly for any fields in the underlying table
that are text, but I get a data type mismatch error for
fields that are Yes/No or numeric.
The code attached to the filter button is as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer
' Build SQL String.
For intCounter = 1 To 5
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) - 5))
' Set the Filter property.
Reports![zrptIssue Log].Filter = strSQL
Reports![zrptIssue Log].FilterOn = True
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help is appreciated!
Thanks in advance.
Liz
the user chooses the appropriate info from a combo box and
clicks a Filter button to perform the actual filter. This
works perfectly for any fields in the underlying table
that are text, but I get a data type mismatch error for
fields that are Yes/No or numeric.
The code attached to the filter button is as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer
' Build SQL String.
For intCounter = 1 To 5
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) - 5))
' Set the Filter property.
Reports![zrptIssue Log].Filter = strSQL
Reports![zrptIssue Log].FilterOn = True
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help is appreciated!
Thanks in advance.
Liz