General discussion


Respond to drop-down menu selection

By Mike Thompson ·

I am trying to create a second dynamic drop-down menu (Menu 2) that responds to the selection made in the first drop-down menu (Menu 1).

The first menu is generated from an Access table via an include file (Include 1).

I have second drop-down menu (Menu 2) that comes from the same table via another include statement (Include 2) in which I'm trying to pass a variable representing the choice made from the first menu (Menu 1)that modifies the SQL used to get the list.

Currently, the second menu (Menu 2) only displays the default item ("Make a selection"). This tells me the variable selected from (Menu 1) is not getting passed to (Include 2) via Request.Form("VariablefromMenu1"). I guess that's b/c (Include 2) is only read when the ASP page is initially loaded/viewed.

How can I make (Menu 2) respond to (Menu 1) w/o writing a bunch of code in the ASP page?



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by john_wills In reply to Respond to drop-down menu ...

The following selects the minor ethnicities of the already selected major ethnicity. Each minor ethnicity row has a reference to the corresponding major ethnicity.
SELECT MinorEthnicityType.Name, MinorEthnicityType.Description, MinorEthnicityType.MajorEthnicityID, MinorEthnicityType.ID
FROM MinorEthnicityType
WHERE (((MinorEthnicityType.MajorEthnicityID)=[Forms]![ClientInformation]![MajorEthnicityID1]))
ORDER BY MinorEthnicityType.Name;

Collapse -

by Mike Thompson In reply to

Hi John,

Thanks for the speedy response! However, the ASP page is not a Data Access Page, so I don't believe this solution would apply to me.

If I'm wrong, where can I find the information for ![Forms]![MyFormName]![Menu1Selection]?



Collapse -

by john_wills In reply to Respond to drop-down menu ...

Forms! etc is the Access way to refer to the contents of an on-screen control. I do not know ASP techniques, but there must be something similar.

Collapse -

by RichTee In reply to Respond to drop-down menu ...

Put code in the AfterUpdate event of Menu1 to requery Menu2. This works for me when I am using multiple drop downs.

Hope it helps. Rich

Related Discussions

Related Forums