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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help on Filter

Status
Not open for further replies.

breukelen

Technical User
Oct 31, 2001
54
NL
Good Morning ,

I have a filter problem :

me.filter = "[bank] = 'Chase' "
me.filteron = true

This filter on my report works fine.
When I choose a bank via combo-box :

Dim BK as string
BK = "=" & combo17

'this works ,I checked with messagebox'

Now when I try to filter :

me.filter = "[bank] = "=" & BK "
me.filteron = true

I get an empty report.
Help is very much appreciated.

Thanks in advance ,

Gunter

 
It looks like you're ending up with a filter:

Me.Filter = "[bank] = = Chase"
...when what you want is your original:
me.filter = "[bank] = 'Chase' "

Try:
me.Filter = "[bank] =""" & me.combo17 & """"

Note the set of 3 double quotes prior to the first &, and the 4 double quotes after the second &. This is because:
a. The bank name is a string.
b. The bank name might contain a single quote, ie "Billy Bob's Big Bank for Bozo's"
--Jim
 
Jim ,

Thanks very much ,you made my day !!!!
Can you advise a good Access-VBA book for this kind of problems ?

thanks again ,

Gunter
 
Gunter,
The one I've found most useful is The Access Developers Handbook (I think that's the title, I don't have it near me at the moment). It is loaded with excellent information, and is a great learning aid.
--Jim
 
Jim ,

Thanks for the information.


best regards,

Gunter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top