View Full Version : Filter Report Error


chris_8
02-28-2008, 10:47 PM
Hi,

I'm headache about filter VBA...:mad:

Refer to filter.jpg, I did click on filter command but there is no report pop up.

Kindly assist to look into my VBA, whichever it's goes wrong.


Thanks!

DCrake
02-29-2008, 01:06 AM
Looking at your VBA code you have not encapsulated the variants in quotes

It should Read "[Field]='" & Criteria & "' And "

Only do this if the variants are string variables

CodeMaster::cool:

chris_8
03-02-2008, 12:25 AM
Hi DCrake,

I tried your solution but seems not working & pop up error as per attached.
Appreciate your help!


Thanks.

Rich
03-02-2008, 01:07 AM
Use the Client ID and not the name displayed, it's easier and less prone to error

CyberLynx
03-02-2008, 01:25 AM
You are not doing what DCrake informed you of. Take a close look at where the apostrophes ( ' ) are located:


If Not IsNull(Me.txtClient) Then
stWhere = "[Client] = '" & Me.txtClient & "' And "
blnTrim = True
End If

If Not IsNull(Me.txtName) Then
stWhere = stWhere & "[Name] = '" & Me.txtName & "' And "
blnTrim = True
End If


.