By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,022 Members | 1,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,022 IT Pros & Developers. It's quick & easy.

Dropdown --> Dropdown --> Dropdown

P: n/a
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is
what I want to do.

I want to create a database that has a form. On this form will be a
dropdown menu (combobox). Depending on what you select in the first
drop down box, another dropdown box will be populated with specific
info based upon what was selected in the first box.

For example:
The first drop down box has "Breakfast" "Lunch" and "Dinner" as a
choice.
The user would select "Breakfast" and then the 2nd dropdown box has
"Eggs" "Sausage" "Pancakes" -
The user selects Eggs, and they can then choose Over Easy, Sunny Side
Up, etc.

I am actually using the DB for bank routing numbers and things like
that, but to make it easy I choose food choices for my example.

Now, I have a table with the "Breakfast Lunch Dinner", and a combobox
will let you see that list and choose which 'meal' you want. I also
have all of the other tables setup with all of the food options and
whatnot.

My question is, how do I get a 2nd dropdown box to populate based upon
what is selected in the first one? Is that even possible? Is there
another way to go about this?

Any help would be appreciated.

Thanks.
Ed

Oct 5 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Greetinx!

Sure, no problem to do that.

Just add the data-string to the next combobox to the "AfterUpdate"-Code of
the previous one.

To stay with your example:

Private Sub ComboboxMeal_AfterUpdate()
If Me.ComboboxMeal = "Breakfast" Then
Me.ComboboxWhatsOnTable.RowSource = "Eggs";"Sausage";"Pancakes"
Elseif Me.ComboboxMeal = "Lunch" Then
[...]
End If
End Sub

And so on you go with your cascading comboboxes. :-)

Just make sure that you set the "Row" (I'm not sure if that's what it's
called) NOT to "Query/Table".

Regards

Michael

"AccessRookie" <ed*****@gmail.comschrieb im Newsbeitrag
news:11**********************@i3g2000cwc.googlegro ups.com...
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is
what I want to do.

I want to create a database that has a form. On this form will be a
dropdown menu (combobox). Depending on what you select in the first
drop down box, another dropdown box will be populated with specific
info based upon what was selected in the first box.

For example:
The first drop down box has "Breakfast" "Lunch" and "Dinner" as a
choice.
The user would select "Breakfast" and then the 2nd dropdown box has
"Eggs" "Sausage" "Pancakes" -
The user selects Eggs, and they can then choose Over Easy, Sunny Side
Up, etc.

I am actually using the DB for bank routing numbers and things like
that, but to make it easy I choose food choices for my example.

Now, I have a table with the "Breakfast Lunch Dinner", and a combobox
will let you see that list and choose which 'meal' you want. I also
have all of the other tables setup with all of the food options and
whatnot.

My question is, how do I get a 2nd dropdown box to populate based upon
what is selected in the first one? Is that even possible? Is there
another way to go about this?

Any help would be appreciated.

Thanks.
Ed

Oct 5 '06 #2

P: n/a
Thank you for the info - I will give it a shot. As I said I am pretty
much a novice in Access so I probably will be here a lot :)

Have a good day

Michael Theymann wrote:
Greetinx!

Sure, no problem to do that.

Just add the data-string to the next combobox to the "AfterUpdate"-Code of
the previous one.

To stay with your example:

Private Sub ComboboxMeal_AfterUpdate()
If Me.ComboboxMeal = "Breakfast" Then
Me.ComboboxWhatsOnTable.RowSource = "Eggs";"Sausage";"Pancakes"
Elseif Me.ComboboxMeal = "Lunch" Then
[...]
End If
End Sub

And so on you go with your cascading comboboxes. :-)

Just make sure that you set the "Row" (I'm not sure if that's what it's
called) NOT to "Query/Table".

Regards

Michael

"AccessRookie" <ed*****@gmail.comschrieb im Newsbeitrag
news:11**********************@i3g2000cwc.googlegro ups.com...
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is
what I want to do.

I want to create a database that has a form. On this form will be a
dropdown menu (combobox). Depending on what you select in the first
drop down box, another dropdown box will be populated with specific
info based upon what was selected in the first box.

For example:
The first drop down box has "Breakfast" "Lunch" and "Dinner" as a
choice.
The user would select "Breakfast" and then the 2nd dropdown box has
"Eggs" "Sausage" "Pancakes" -
The user selects Eggs, and they can then choose Over Easy, Sunny Side
Up, etc.

I am actually using the DB for bank routing numbers and things like
that, but to make it easy I choose food choices for my example.

Now, I have a table with the "Breakfast Lunch Dinner", and a combobox
will let you see that list and choose which 'meal' you want. I also
have all of the other tables setup with all of the food options and
whatnot.

My question is, how do I get a 2nd dropdown box to populate based upon
what is selected in the first one? Is that even possible? Is there
another way to go about this?

Any help would be appreciated.

Thanks.
Ed
Oct 5 '06 #3

P: n/a
AccessRookie wrote:
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is
what I want to do.

I want to create a database that has a form. On this form will be a
dropdown menu (combobox). Depending on what you select in the first
drop down box, another dropdown box will be populated with specific
info based upon what was selected in the first box.

For example:
The first drop down box has "Breakfast" "Lunch" and "Dinner" as a
choice.
The user would select "Breakfast" and then the 2nd dropdown box has
"Eggs" "Sausage" "Pancakes" -
The user selects Eggs, and they can then choose Over Easy, Sunny Side
Up, etc.

I am actually using the DB for bank routing numbers and things like
that, but to make it easy I choose food choices for my example.

Now, I have a table with the "Breakfast Lunch Dinner", and a combobox
will let you see that list and choose which 'meal' you want. I also
have all of the other tables setup with all of the food options and
whatnot.

My question is, how do I get a 2nd dropdown box to populate based upon
what is selected in the first one? Is that even possible? Is there
another way to go about this?

Any help would be appreciated.

Thanks.
Ed
In combo1 you have a rowsource from a table something like
Select EatWhatID, EatWhat From Eating
and this displays breakfast, lunch, dinner. EatWhatID is a hidden
column value.

In Combo2, your rowsource might be
Select FoodsID, Food From Food Where EatWhatID = _
Forms!ThisFormName!EatWhatID

This links the EatWhatID in the Foods table to the EatWhatID in the
Eating table.

When you make a change, in the afterUpdate event for combo1, enter
something like
Me.Combo2.Requery
and this will force a requery of the rowsource for combo2 with the new
results available for selection.
Oct 5 '06 #4

P: n/a
"AccessRookie" <ed*****@gmail.comschreef in bericht
news:11**********************@i3g2000cwc.googlegro ups.com...
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is
what I want to do.

I want to create a database that has a form. On this form will be a
dropdown menu (combobox). Depending on what you select in the first
drop down box, another dropdown box will be populated with specific
info based upon what was selected in the first box.

For example:
The first drop down box has "Breakfast" "Lunch" and "Dinner" as a
choice.
The user would select "Breakfast" and then the 2nd dropdown box has
"Eggs" "Sausage" "Pancakes" -
The user selects Eggs, and they can then choose Over Easy, Sunny Side
Up, etc.

I am actually using the DB for bank routing numbers and things like
that, but to make it easy I choose food choices for my example.

Now, I have a table with the "Breakfast Lunch Dinner", and a combobox
will let you see that list and choose which 'meal' you want. I also
have all of the other tables setup with all of the food options and
whatnot.

My question is, how do I get a 2nd dropdown box to populate based upon
what is selected in the first one? Is that even possible? Is there
another way to go about this?

Any help would be appreciated.

Thanks.
Ed
From a post of Bob Quintal on Cascading Comboboxes:
>>>
Here's a good one
http://experts.about.com/q/Using-MS-...scading-combo-
boxes.htm
here's a sample database example.
http://www.utterangel.com/pages/acce...nloads.aspx#43
>>>
john
Oct 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.