Dgavilanes
06-25-2001, 10:28 AM
How can link one combo box to another:
first box list all categories, and combo box 2 list all subcategories based on selection from combobox #1
thanks
pdx_man
06-25-2001, 04:41 PM
In the recordsource for the second combo box, have criteria referencing the first combo box. You will have to do a form refresh after the first box is selected, but this will work.
Dgavilanes
06-26-2001, 05:47 AM
combo #1 = Categories
Combo #2 = Subcategories
#1 fields are: Casa; Test; Courses, when I select courses from combo box #1, I would like to see in combo box 2: Math, English, Geography etc.
what criteria can I placed on row source #2 in order to get this
any help will be grealy appreciated
Pat Hartman
06-26-2001, 06:07 AM
Use a query as the row source for combo2 and in that query, use the following as criteria for the category field. Change the Form and control names to those from your form:
Forms![YourFormName]![TheNameOfCombo1]
kgcrowther
06-26-2001, 06:12 AM
First I would create a table with catagory and sub catagories. Set the primary field as the combonation of the two.
In the first combobox set the row source as a query that looks to the table you created. Right click to turn on the totals so that you get the 'grouped by' in the totals section. (This way it won't repeat repeated items in the combo box) Go to the event 'AfterUpdate' and enter something like:
Me.Combo2.Requery
Go to the second combo box and enter a parameter query as the row source. So the first column in the query biulder is subcatagory (the the show box checked) the second column is the catagory with the totals row reading 'Where' in the criteria enter the parameter "[Forms]![TheName of this form here]![name of combo1 here]"
If this is unclear tell me. I do this a lot of all my forms and it works great.
Kenneth