Linking two combo boxes

mhisma

Registered User.
Local time
Tomorrow, 02:53
Joined
Sep 20, 2007
Messages
28
Dear All,
I have two tables and a form described below ( example only)

Table A
Housing_Complex_Name
Alpha
Bravo
Charlie

Table B
House_name Housing_complex_Name Rooms Doors Windows
Alpha01 Alpha 4 5 10
Alpha02 Alpha 4 3 9
Alpha03 Alpha 4 6 11
Bravo01 Bravo 6 4 12
Bravo02 Bravo 6 3 9
Bravo03 Bravo 6 4 12
Charlie01 Charlie 8 4 12
Charlie02 Charlie 8 3 9
Charlie03 Charlie 8 4 12

Based on two above tables, i create a form with two combo boxes and three text boxes. combo_box1 will contain housing complex name ( Alpha, Bravo and Charlie),combo_box2 will contain list of house name, text_box1 will display room, text_box2 will display door and text_box3 will display window

What should I do when I choose Alpha on combo_box1, combo_box2 will display only Alpha01, Alpha02 and Alpha03? And when I choose Alpha01 on combo_box2, text_box1 will display 4,the text_box2 will display 5 and text_box3 will display 10?
Kindly need your advise
 
Search here on cascading combos, which is what you want for the combos.
 
thanks for the answer,
I have successfully linked the two combo boxes

but how can I update the value on the text_box1 (ROOMS) based on the value selected on combo_box2 (HOUSE_NAME)?
Usually I use the code as written on code sheet ( on the attached mdb)

Kindly need your help, i am frustrating with this
 
as pbaldy said.. look in the Sample Db's section of this forum there are plenty of examples of this floating around.
 
The method you attempted would work, but your SQL:

Me.HOUSE_NAME.RowSource = "SELECT HOUSE_NAME.HOUSE_NAME FROM...

does not include those fields, so obviously they're not available to the code.
 

Users who are viewing this thread

Back
Top Bottom