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

Modify Listbox list

Status
Not open for further replies.

Basshopper

Technical User
Dec 27, 2003
114
US
I have an unbound list box of Customers in a form. I can scroll click on the customer and that data comes up in the form. Each customer is classified in a field called Class. What is the best way to filter the customer list box list by class to shorten the list. Can you use another list box (class) to change the customer list in that list box. If so what's best way, I do a lot of moving between froms so I don't want to have to do some typed in parameter all the time. The class list is somewhat dynamic in that is can change or have other classes added so not sure checkbox or button would be very useful. Thanks in advance for your help.
 
click on FAQs for this forum. There are several examples of ways to filter a combo or listbox based on another combo or listbox.
 
I assume you have a table where you keep your Class information, with some ClassID as your PK. And then you have a Customers table where you may have a CustID as PK and a ClassID as FK

If so, you may display Class information in a combo box, and for every selection of Class you populate your list of Customers where ClassID is whatever you have chosen from Class combo box.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Both fields are in sa[pre][/pre]me table, I will check out faq when I get back home Sunday. Thanks for suggestions
 
MajP: Would this combo box FAQ work with just 1 table as both of these fields are in the same table or do I have to separate first?
 
You would need two queries from that table. The first query would be something like
Select Distinct Class from Customers
This would get you one of each Class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top