G
Gina Whipp
Hello All,
I have used this code over and over again but never on date fields. Now I
am trying to use on date fields (Start Date, End Date) and I keep getting
'Data type mismatch in criteria expression'. Now I have used m/yyyy fields
with no problems, why is the entire date giving me a problem?
Dim strSql As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 2
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) - 4))
'Set the Filter property
Reports![rptCheckingLog].Filter = strSql
Reports![rptCheckingLog].FilterOn = True
Else
Reports![rptCheckingLog].FilterOn = False
End If
Thanks,
Gina
I have used this code over and over again but never on date fields. Now I
am trying to use on date fields (Start Date, End Date) and I keep getting
'Data type mismatch in criteria expression'. Now I have used m/yyyy fields
with no problems, why is the entire date giving me a problem?
Dim strSql As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 2
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) - 4))
'Set the Filter property
Reports![rptCheckingLog].Filter = strSql
Reports![rptCheckingLog].FilterOn = True
Else
Reports![rptCheckingLog].FilterOn = False
End If
Thanks,
Gina