Solved

How filter combobox based on another combobox on a form

Posted on 2016-10-20
1
44 Views
Last Modified: 2016-10-21
I have two comboboxes on a form.  The first one is named cboTYPE.  Depending on the selection made in this combobox I want to filter the available choices in the 2nd combobox.

For example, if the user selects "Football" in the 1st combobox, then I want the option to select only "Brown" in the 2nd combobox.  But if the user selects "Tennis Ball" in the 1st combobox then I want either "Yellow", "Green", or "Purple" to show up in the 2nd combobox.

How can I do this?
0
Comment
Question by:SteveL13
1 Comment
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41852734
There are a number of options.  The one I use is:

Change the WHERE clause in the RowSource  query for the dependent combo to reference the parent combo.

Where Type = Forms!yourform!cboType

Then in the AfterUpdate event of cboType, requery the dependent combo.

Me.cboTeam.Requery
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now