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

Access 2nd drop down list help

P: n/a
I need some help! I'm trying to set up two drop down menus where the
first displays the Department and the second displays the names of the
printers found in the department.

So far i have two tables, one called tbldepartment and the other
called tblname. Tbl department has 2 fields in it which are ID and
department name(i've set ID to autonumber and it is the primary key).
Tbl name also has two fields in it which are IDTab and name(ID Tab is
the primary key and is not autonumber) .

The problem is i'm getting the first drop down list displaying ok but
the second shows all the printer names instead of the ones related to
the department. I thought if i put some code in the On click field in
the first listbox to tell it to go to the Tbl name and select the
printername with the matching id to the department table then my table
would work!

Only problem is i don't know how to go about the visual basic code
that is required.
Does anyone know how to do this? I'm stuck :-(

Jun 24 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
For the second drop down you need to create a query linking the
Department table with the Printer table.
On this query, you need to have the first drop down (Department combo)
as a criteria for the field 'Department'.
Say your form is called 'Department Printers' and your drop down for
Department is called 'combo0' then your criteria should be something
like [Forms]![Department Printers]![combo0].
This way, every time you invoke the Printer drop down, it will narrow
the results to the department you have selected in the Department drop
down.

HTH - Max

Jun 24 '07 #2

P: n/a
the contents of the second combo box's droplist will not change
*automatically* when the value in the first combo box changes, though. add a
macro or VBA procedure to the first combo box's AfterUpdate event, as

Me!SecondComboboxName.Requery

if the form is used to display existing records as well as to enter new
records, add the same macro or VBA procedure to the form's Current event,
too.

hth
"Max Vit" <mv**@safe-mail.netwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
For the second drop down you need to create a query linking the
Department table with the Printer table.
On this query, you need to have the first drop down (Department combo)
as a criteria for the field 'Department'.
Say your form is called 'Department Printers' and your drop down for
Department is called 'combo0' then your criteria should be something
like [Forms]![Department Printers]![combo0].
This way, every time you invoke the Printer drop down, it will narrow
the results to the department you have selected in the Department drop
down.

HTH - Max

Jun 24 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.