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 Boxes in Access 97

Status
Not open for further replies.

tamalou

Programmer
Sep 28, 2001
9
CA
Thanks everyone for all your tips so far. I think I almost have it.

Table looks like this:

Main Sub
A 1
A 2
B 3
C 4
C 5

I have a form with 2 combo boxes
Combo1 contains the data from Main Category
Combo2 should contain only the subcategories for the main category chosen in combo box one

Decyphering all the suggestions so far, here is what I have done:

Combo1 Rowsource is set up as
Select Distinct [Main Cetgory] from [TableName]

Combo2 rowsource is set up as a query which which cites the following criteria under Main category
[Forms]![formname]![Main Category]
Display deactivated
And the subcategory with display activated

Combo1 AfterUpdate - a Macro to run the Query

Everything seems to work EXCEPT that the query runs and the datasheet appears. But when I close the datasheet, the right subcategories appear in the combo box which is much better than before

How do I stop the datasheet from popping up (keeping in miond I am using 97). i don't want to see it, I just want the combo box to update. Any Suggestions.




 
Hi!

Instead of running a macro from Combo1 AfterUpdate, choose the [Event Procedure] option. In the event procedure type this code:

Me!Combo2.Requery

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top