
Hi i have a pop-Up filter form which filters the records on a report.
1 to 5 of the filters work great but the other two 6 to 7 dont work and come back with a error.
I understand that the Error is due because im filtering on Date formats for two of them 6 and 7. Is there anyway to resolve this here is the code below.
Regards Richard
Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 7
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![QECDLReport].Filter = strSQL
Reports![QECDLReport].FilterOn = True
End If
End Sub
P.S
By the way im sorry i am just new to vba. Thanks all