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

Filter a Combo Box

Status
Not open for further replies.

kburnham

Technical User
Apr 14, 2001
4
0
0
US
Access 97

I want to maintain one list referenced by several combo boxes. Instead of the users having to look through a list of 40 items, I want to filter it based on the field they are in. For example, if they are in the field called CHAIR, I want the combo box to only show the 14 chairs in the list.

I have modified my list table to include a "category" field in the hopes that I can have code that says to only display the "description" field for those records where the "category = Chair".

Any help would be greatly appreciated!!!

 
Place something similar to the following in the Row Source Property of your Combo Box,

SELECT DISTINCTROW [Table1].[category] FROM [Table1] where [category]="chair";

Replace the final string in the above with the value in
the field you are looking at and the list in the Combo Box will reflect changes. Experiment!

Hope this assists.

Regards,



Chris.
 
OH, YEAH!!!!
Yes, yes, yes, yes, yes!!!!!
Thank you SO much, Chris - simple and DONE!!!
Karen

 
Cor! Such excitement .. almost pornographic :) You are very welcome Kaz, glad I was able to help, ages since I've answered any Access Queries ( pun possibly intended.. )

Kind regards,

Chris
support@xeotech.co.uk
 
Chris

This is also good for me, but How do i get it to work over two combo boxes? for example, i have one called "Hardware Vendor1" then another next to that called "Hardware platform1"

How do i get it to work so that when selecting IBM in hardware vendor, only AS400, etc appears in the options to select form in the other combo box? I think i have an idea, but im not sure which combo bo i need to play with the properties? Thank you for your help already.

Matt Pearcey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top