how a combo box populate other combo box....

  • Thread starter Thread starter zerocool.farooq
  • Start date Start date
Z

zerocool.farooq

Hello every body
i have a problem hope ill got some solution from this forum, is
that i have two combo box one is created by a table which is main
catagory lists and other is created by a query which have a parameter
which have sub-catagory i want that when i select the any main catagor
from first combo box automaticaly second combo box populated with
sub-catagory related with main catagory. how to do this help
plzzz....ill be very thankful for all for helping me...

zerocool
 
Hi -


In the after update event of comboBox1, put code something like this:

dim SQL as string

sql="Select FieldName from Subcategory where subcategory.category = '" &
me!combobox.column(0) & "'"

me!combocox2.rowsource = sql

This is just an example; if the category value is numeric, you won't
need the quotes, and you will have to be sure to get the column
reference right - remember that the first column in the combo box is
column(0).

Hope this helps

John
 
Back
Top