How do I set up a drop-down menu?

A

archgirl

I'm trying to set up database in access for museum where you click a
selection on the drop-down menu that summons another drop-down menu with
additional choices based on your previous selection. This would need to be
at least 3 levels of selections.
 
M

Micah Chaney

Hello! First of all -- If anyone has a more efficient (SQL) way of doing
this, please let her know. Archgirl, I'm not very good with code at all, but
I can give you a simple roundabout way to do this. Let's see if I can
explain this clearly.

What you'll want to do is create 3 drop down fields. (You'll need to
utilize the Toolbox in the Form design view) Each field will have its record
source from a different Query.

Let's see if you can follow this:
Create QueryA:
Based off the appropriate Table.
Include only the field you want displayed in the first Combo Box
Utilize the GroupBy feature on this field (File Menu | View | Totals)

Create QueryB:
Based off the same Table as QueryA and QueryA
Connect the field in QueryA to the same field in the Table.
Modify the link so that the arrow is pointing towards the Table (Include
all records in the Query and only those records that match in the table.
Drag down the field from the Query.
Drag down the field from the Table that you want displayed in Combo Box2
Utilize the GroupBy feature on this field (File Menu | View | Totals)

Create QueryC:
Based off the same Table as QueryB and QueryB
Connect the field from the Query (not the same field as QueryA) to the
same field in the Table.
Modify the link so that the arrow is pointing towards the Table (Include
all records in the Query and only those records that match the table.
Drag down the field from the Query (Again not the one from QueryA).
Drag down the field from the Table that you want displayed in Combo Box3.
Utilize the GroupBy feature on this field (File Menu | View | Totals)

I hope you're with me so far...like I said it's roundabout.

Now in the Form, Create 3 Combo Boxes. Say you name them Combo1, Combo2,
and Combo3...OK? (If the wizard pops up, just click cancel).
In the Combo1 properties | Data Tab | Row Source Type: Table/Query and Row
Source: QueryA.

Combo2: Same thing except Row Source: QueryB.
Combo3: Same thing except Row Source: QueryC.

Now close and save your form. Say you call your Form, Form1. Open QueryB
in Design View.

In the criteria portion of the Query...Input this for the field from QueryA:
[Forms]![Form1].[Combo1] Save the Query.
Open QueryC. For the Criteria for the field you get from QueryB:
[Forms]![Form1].[Combo2] Save the Query.

In order for this to work you need to have all 3 Queries open when you
utilize the form. You can have them minimized or hidden. What you can do is
create a Macro, that Opens all 3 Querys in Hidden Window mode. Have this
Macro run whenever the form is opened.

In summary what you have is, each of these Combo Boxes is based off of a
Query. QueryA groups provides the choices for Combo1. When Combo1
populates, QueryB groups the choices for Combo2 for those records whose value
matches that of the value in Combo1. Make sense? Same thing with QueryC and
Combo3. This may sound confusing, let me know if you need more help with
this. If you want you can email me at Chaney34 "at" yahoo "dot" com, and
I'll provide you a phone number and gladly walk you through it over the
phone.

Just so you know, I tried this as I'm typing this down for you, so I know
it'll work. Hopefully though either you get it, or someone has an easier
solution.

Good Luck.
 
A

Albert D. Kallal

Are you talking about standard permanent menus, or a cascading tree like
interface to get some type of selection from the user?

You can certainly make cascading menu structures (we are talking about
standard menus just like you have in word, or Excel, or ms-access). These
kind of menus are not for data...but simply for user interface to select
options in a menu. You can see some screen shots (later on) in the following
web page of mine where I use cascading menus in ms-access:

http://www.members.shaw.ca/AlbertKallal/Articles/UseAbility/UserFriendly.htm.

If you are looking to make some kind of drill down for data, perhaps you
don't need 3 levels. Take a look at the following screen shots, and note how
the first screen drills down to a 2nd "set" of data. You could certainly use
this idea and have 3 list, or 3 sub-forms on a form. This idea thus could
work for 3 levels, as the example screen shot is 2 levels as is:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

Also, take a look at the following forms for searching:

http://www.members.shaw.ca/AlbertKallal/Search/index.html
 
Top