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

How to filter a field based on the other fields in the form?

P: 22
Hi,

I have a form where user enters an ID in a text box, the ID is actually 10 digits, but even if the user enters 5-6 digits , my code is supposed to pick tht and based on tthis it should populate a combobox with all relative products( product IDs). how do i do this ?

Expand|Select|Wrap|Line Numbers
  1. Form.RecordSource = "Select * from table1"
  2. Form.Filter = "ID='" & User entered id& "'"
  3. Form.FilterOn = True
  4.  
What is that i m supposed to specify (equivalent to the Sql syntax LIKE)???
in the second line how do i specify it?

Thanks so much in advance!!
Jan 22 '08 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,679
Hi,

I have a form where user enters an ID in a text box, the ID is actually 10 digits, but even if the user enters 5-6 digits , my code is supposed to pick tht and based on tthis it should populate a combobox with all relative products( product IDs). how do i do this ?

Expand|Select|Wrap|Line Numbers
  1. Form.RecordSource = "Select * from table1"
  2. Form.Filter = "ID='" & User entered id& "'"
  3. Form.FilterOn = True
  4.  
What is that i m supposed to specify (equivalent to the Sql syntax LIKE)???
in the second line how do i specify it?

Thanks so much in advance!!
Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[ID] Like '" & Me![txtUserID] & "*'"
Jan 23 '08 #2

P: 22
Thank you so much, Its pretty much the same, i was wondering if i can really use it. Anyways Thanks very much!
Jan 23 '08 #3

ADezii
Expert 5K+
P: 8,679
Thank you so much, Its pretty much the same, i was wondering if i can really use it. Anyways Thanks very much!
You are quite welcome. The crazy thing about this business is that pretty much the same usually does not get the job done (LOL).
Jan 24 '08 #4

Post your reply

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