By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Cascading Combo Box Woes...

P: 2
I am new to Access and am having a problem. I have three cascading combo boxes in Access 2007 on a form. Two of them work perfectly, but the third one gives me an error "The expression is typed incorrectly, or it is too complex to be evaluated." I have tracked it down to the WHERE statement in the Query, but the statement is the exact same as the other Queries. Maybe I need different code to get a third cascade?

Tables are Assets, Category, Make and Model.
Queries are Make Query and Model Query.
Form is Asset Details.
First combo box is cboCategory that pulls from the Category table. It has an AfterUpdate event to requery the cboManufacturer combo box. Coded like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboCategory_AfterUpdate()
  2.     Me.cboManufacturer.Requery
  3. End Sub
  4.  
Second combo box is cboManufacturer that uses the Make Query to look at cboCategory to determine what to show. SQL looks like:
Expand|Select|Wrap|Line Numbers
  1. SELECT Make.MakeID, Make.Make, Make.Category
  2. FROM Make
  3. WHERE (((Make.Category)=[Forms]![Asset Details]![Category]))
  4. ORDER BY Make.Make;
  5.  
This combo box works perfectly. It has an After Update event to update cboModel. Code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboManufacturer_AfterUpdate()
  2.     Me.cboModel.Requery
  3. End Sub
  4.  

Third combo box is cboModel that uses the Model Query to look at cboManufacturer to determine what to show. SQL looks like:
Expand|Select|Wrap|Line Numbers
  1. SELECT Model.ModelID, Model.Model, Model.Make
  2. FROM Model
  3. WHERE (((Model.Make)=[Forms]![Asset Details]![Manufacturer]))
  4. ORDER BY Model.Model;
  5.  
The WHERE statement above is the problem, but it looks like it should work. Maybe you just cant have two dependant combo boxes on one form?

I have attached a copy of a simplified version of the database. I am in the process of modifying a template and still weeding out parts I don't need. So far everything else works fine.

Any help is appreciated. Thanks.

Marc
Attached Files
File Type: zip Inventory Test.zip (113.9 KB, 54 views)
Jan 5 '12 #1

✓ answered by Seth Schrock

There is no such thing as a Make Query. There is a Make Table query, but that is obviously not what you are trying to do. This is a Select query. You can have two dependent combo boxes on the same form.

There were a few mistakes in your database. First, I changed both cboManufacturer and cboModel to be bound to column 1 (control properties, data tab). Then I changed the cboModel's row source to be the query Model Query. I had to try a few things, but I think that is what you need.

Share this Question
Share on Google+
3 Replies


Seth Schrock
Expert 2.5K+
P: 2,931
There is no such thing as a Make Query. There is a Make Table query, but that is obviously not what you are trying to do. This is a Select query. You can have two dependent combo boxes on the same form.

There were a few mistakes in your database. First, I changed both cboManufacturer and cboModel to be bound to column 1 (control properties, data tab). Then I changed the cboModel's row source to be the query Model Query. I had to try a few things, but I think that is what you need.
Jan 6 '12 #2

NeoPa
Expert Mod 15k+
P: 31,186
I assume you are having trouble with Cascaded Form Filtering. Have a look at a working version in the link and see where and how yours differs.
Jan 6 '12 #3

P: 2
Thank you Seth. That fixed the problem. It's always something simple.
Jan 9 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.