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

Filtering data when using Combo Boxes

Status
Not open for further replies.

a23freak

Programmer
Nov 18, 2002
8
0
0
CA
Hi,

I have a form that has 4 data combo boxes. They are being populated via the same SQL. I would like the 2nd combo box to show the filtered results based on the selection made in the 1st combo box.

Any help is greatly appreciated.

A23freak
 
Try putting code behind the 1st Combo’s Click event. This code should set the 2nd combo to whatever you need.
 
The problem I am having is coming up with the right code to do this.

 
If the item in combo1 is numeric:

"Select YourFields from YourDatabase where TestField = " & val(combo1.list(combo1.listindex))

If it's string:

"Select YourFields from YourDatabase where TestField like '" & combo1.list(combo1.listindex) & "'"


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top