Solved

How filter combobox based on another combobox on a form

Posted on 2016-10-20
1
34 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 34

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

863 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

20 Experts available now in Live!

Get 1:1 Help Now