Solved

Cascading Combo Box in ACCESS

Posted on 2013-06-14
4
1,026 Views
Last Modified: 2013-06-24
I have a list of names (consists of Last Name and First name fields) in my table and like to create cascading combo boxes :
When I select the last name in the last_name combo box and tab over to next combo box, I want the first names in alphabetical order that has the same last name.

Last Name    First Name
----------------    ------------------
Brown          Bobbie
Brown          Jim
Jackson         Adam
Jackson         Bobby
Jackson         Issac
Jackson         Jack
Jackson         Toni
Johnson        Sam
Johnson        Lonnie
0
Comment
Question by:sglee
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 265 total points
ID: 39248917
Simple enough.

Base the 2nd combo's rowsource on a query.  In that query, create a column for LastName and under that, put a criteria check of:

=Forms![<yourformname>]![<yourlastnamecontrolNam>]

replace everything in the < > (and including them) with the name of your form and control.

Now in the 1st combo's AfterUpdate event, do:

  Me.<my2ndCombo'sControlName>.Requery

 This will force combo 2 to execute the rowsource query, which will then filter based on the 1st combo's value.

Jim.
0
 

Author Comment

by:sglee
ID: 39248948
Could you post actual screenshots of the queries and control properties?
0
 
LVL 57
ID: 39251261
Just give it a shot.  It's not all that hard.   Should take you no more then ten minutes at most (I'm assuming you already have the rowsource queries setup for the combo's, but even if not, it's still not all that hard).

 If you really get stuck, I can whip something up.

Jim.
0
 

Author Comment

by:sglee
ID: 39273530
That works! Thank you.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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