Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report filter problem

Status
Not open for further replies.

liltechy

Programmer
May 17, 2002
145
US
I copied a report filter from the RptSmp00.mdb sample database, below is the code for the filter. One of my filters is a date field, when I try to apply the filter I get a type mismatch error. Can someone help?

Dim strSQL As String, intCounter As Integer
'Build SQL String
For intCounter = 1 To 5
If Me(&quot;Filter&quot; & intCounter) <> &quot;&quot; Then
strSQL = strSQL & &quot;[&quot; & Me(&quot;Filter&quot; & intCounter).Tag & &quot;] &quot; & &quot; = &quot; & Chr(34) & Me(&quot;Filter&quot; & intCounter) & Chr(34) & &quot; And &quot;
End If
Next

If strSQL <> &quot;&quot; Then
'Strip Last &quot; And &quot;
strSQL = left(strSQL, (Len(strSQL) - 5))
'Set the Filter property
Reports![rptCustomers].Filter = strSQL
Reports![rptCustomers].FilterOn = True
Else
Reports![rptCertificates].FilterOn = False
End If


liltechy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top