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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box based off another combo box

Status
Not open for further replies.

Aerowolf

Programmer
Nov 6, 2002
64
I have the following tables:

Categories with a Category field.
Types with Category and Type fields.

I have form Items with subform ItemCats.
In subform ItemCats I want the user to select the Category and then select the Type using combo boxes, but I want the Type combo box to be filtered based on the selection in the Category combo box.

Here's the code I have so far for the Type combo box:

SELECT [TYPES].[TYPE], [TYPES].[CATEGORY] FROM TYPES WHERE ((([types].[category])=[Forms]![ITEMCATSsubform]![CATEGORY])) ORDER BY [TYPES].[TYPE];

Why won't it work?

Thanks
Edwin
 
You can not reference a subform by its name. Subforms do not get loaded into the Forms collection. So if this is on a subform you have to reference it through the main form.
[forms]![mainFormName]![subFormControlName].form![CATEGORY]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top