View Full Version : Combo Box Values


popen
03-27-2001, 12:15 AM
I am using Access 2000 and on a specific form, I have 2 combo boxes which obtain values from different tables. What I am trying to achieve is the following:
When the value is selected on the 1st combo box (In this instance under the field SPECIALITY), the second combo box (Sub Speciality) will show a list of values from a table which is unique to the 1st combo value.
There are multiple tables.....one for each value chosen from the Speciality cmbo box and these in turn have different fields to be shown in the Sub Speciaility cmbo box .
Anyone know how to do this ?
Many thanks in advance.

Pat Hartman
03-27-2001, 06:34 PM
In the AfterUpdate event of the first combobox you'll need to set the recordsource of the second combobox to whatever table or query you want and then you'll need to requery the second combobox.

popen
04-12-2001, 01:04 AM
Thank you for your reply Pat.
Could you give me an idea of what code I need for this ?
I am really in need of help on this one !
Many thanks,

-NEIL L POPE

Regina
04-17-2001, 08:23 AM
Neil,

You need to write a query that shows values in box 2 according to waht you have written in box 1. I was faced with this problem where a country of residence was entered for a user and a second box came up listing all offices in that country. Hence i enterd the following SQL text:

SELECT Building.[Building name]
FROM Building
WHERE Forms![Employee]![Country] = Building.[Country];

Hence if "Building![Country]" was UK on the form it would bring a list of all buildings that fitted this criteria from the "Building" table. The name of this query then is entered in the "Row source" space of the second box. Hope this helps!