Drop down boxes

G

Guest

Is there a way to create two fields, both drop-downs, have 5 drop-downs in
the first field, and when you select one value in the first drop-down, it
would show one of five drop downs with many values in the second field. OK I
have a first drop down this Training, Wiring, Network Wiring, Blah, Blah.
When you select Training in the first drop-down, the second drop down would
show only the training values that you can select from. Or if in the first
Drop-down you select Wiring, and the next drop-down gives you only wiring
values, and so on. thanks in advance.
 
R

Rick B

Yes. This is called "cascading combo boxes". Do a search and read the
previous posts on this very common question and you will find ways to
accomplish this.

Please always search for your answer before posting a new thread.
 
J

John Vinson

Is there a way to create two fields, both drop-downs, have 5 drop-downs in
the first field, and when you select one value in the first drop-down, it
would show one of five drop downs with many values in the second field. OK I
have a first drop down this Training, Wiring, Network Wiring, Blah, Blah.
When you select Training in the first drop-down, the second drop down would
show only the training values that you can select from. Or if in the first
Drop-down you select Wiring, and the next drop-down gives you only wiring
values, and so on. thanks in advance.

You cannot do this in a table datasheet (just one of many, many
limitiations; table datasheets are NOT designed for user interaction
but for data storage). However, it's pretty easy on a Form based on
your table. You need just a tiny bit of VBA code.

Base the second Combo Box (the proper term for a "drop down") on a
query using

=[Forms]![YourFormNameHere]![ComboBoxNameHere]

as a criterion; this will filter the rows displayed in the second
combo to those which match the first.

The code is one line, in the AfterUpdate event of the first combo box.
View the combo's Properties; click the ... icon by the After Update
event on the Events tab; choose Code Builder; and edit it to

Private Sub ComboBoxNameHere_AfterUpdate()
Me!SecondComboBoxNameHere.Requery
End Sub

using of course your actual combo box names.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top