By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,248 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,248 IT Pros & Developers. It's quick & easy.

creating and using a filter

P: 12
I am trying to use the filter method with a form

Using the Access/VBA documentation I have created a filter which looks like this

Expand|Select|Wrap|Line Numbers
  1.  
  2. me.filter = "lngCaseID = 18905"
  3. me.filter on = true
  4.  
  5.  

this works fine.

I have tried using the same method including a varible based on a control

it looks like this

Expand|Select|Wrap|Line Numbers
  1.  
  2. Me.Filter =  """lngCaseID = " & Forms.frmUrgentTriage1.tboCaseID  _ & """" 
  3. me.filter on = true
  4.  
  5.  
or

Expand|Select|Wrap|Line Numbers
  1. thisFilter = """lngCaseID = " & Forms.frmUrgentTriage1.tboCaseID  & """" 
  2.  
  3. me.filter = thisFilter
  4. me.filter on = true
  5.  
and neither works despite the fact that when I debug.print the string is the same string as if I hard coded it.

any suggestions.

thanks greatly!!
Feb 27 '09 #1
Share this Question
Share on Google+
3 Replies


100+
P: 675
thisFilter = "lngCaseID = " & Forms!frmUrgentTriage1.tboCaseID
Me.FilterOn = True
Feb 27 '09 #2

P: 12
thanks - where is that secret kept?
Feb 27 '09 #3

100+
P: 675
Access Help -> Filter Property
Feb 27 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.