Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Problems

Status
Not open for further replies.

tamalou

Programmer
Sep 28, 2001
9
CA
I have two tables a main Categories and SubCategoreis. I have the sub categories table set up as follows:

Pricing Admin
1 A
2 B

Etrc
I have a form. Combo box lists values in Main category table . No problem. the Second Combo Box I have is supposed to list only the sub category values for the Main Category item displayed. Not working. i have tried writign code. Settign up an Expression in the AfterUpdate in the first combo box. i think I am goign to lose my mind. Please help.
 
Tamalou,

I'm not tracking on your table layout, but you should be able to modify the SubCategory combo box query.

The folllowing assumes your combo box for MainCategories is Combo1 and for SubCategories it is Combo2.

In the Form design view, select Combo2 and in the property pane click on the elipsis at the end of the rowSource line. This will open the QBE view for the SubCategories combo box.

In the criteria line for the MainCategory field, type:
Code:
 [Forms]![yourformname]![Combo1]

Close the query and select yes to save the changes.

Back in Form design view, write
Code:
Combo2.Requery
as the BeforeUpdate event on Combo1.


HTH

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top