473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cascading Combo Box Woes...

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, 84 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.

3 1837
Seth Schrock
2,965 Expert 2GB
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
32,556 Expert Mod 16PB
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
Thank you Seth. That fixed the problem. It's always something simple.
Jan 9 '12 #4

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

Similar topics

0
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding ...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
3
by: buddyr | last post by:
Hello, Yesterday I recieved help with two cascading combo boxes on an access form. I went the link http://www.fontstuff.com/access/acctut10.htm And basically used their first example. Now I...
4
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields...
1
kcdoell
by: kcdoell | last post by:
Good Morning: I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off: Procedure declaration...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
7
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm...
8
by: 20028431 | last post by:
This is driving me mad! I have been trying for 3 days now to work out how to do this with no success. I have tables for Customer, Bookings, Entertainment, Act, Agent, and several others. I...
3
by: MOCaseA | last post by:
I have a record lookup form that has several combo box filters set up. However I noticed a slight problem. The filters are working correctly, but there are now over 2000 entries and when filtering...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.