Cascading Combo Boxes

lansel

Registered User.
Local time
Today, 10:47
Joined
Jul 2, 2003
Messages
72
This is the first time I have tried to create cascading combo boxes and I have been working on it all day. My problem is when I get to the dependent combo box. I use a table source for the first combo and it is working until I enter the code for updating the dependent combo box. I have several tables for the dependent combo box. The information I have been reading does not really explain how to creat the second combo box if you are not designating one table to it. It does say that no row source is specified for the dependent combo box, so how do you create it?

I have the After update code information, but I need to create the second combo box.

What I am trying to do is put the name of the customer in the first combo box, so I have a TableCustomer. In the dependent combo box, I have several customer tables with the labels listed for that customer, so I want the dependent combo box to list the labels for the customer I select in combo box 1.

I appreciate your assistance.
 
I am still working on my problem.

Thank you so much for the information.
 
I created a query from my two tables Customers and labels

Customer ID Customer Label
1 Bristol Farm 21-up
1 Bristol Farm 48-up
2 Cardenas 8-up
2 Cardenas 18-up

and so forth with 10 different customers

I created the combo boxes using the query. When I open the combo box the same customer is listed as many times as in the table and the labels is the same way. When I put the [Forms]![Formmain]![Combo4] in the query nothing is shown in either combo box. I have looked at two different methods. The other method has the "SELECT DISTINCT...." in the Row Source to keep the customer name from repeating. I can't get it to work. Please help!

Thanks,
 
Happy dance! I finally got it to work. Thanks for all the tutorials and videos that you guys posted.
 
Well I did my happy dance too soon! I thought I had the form working correctly as far as visually, but when I looked at my table to see if the information was being entered correctly, I was getting the customer ID number instead of name in the table. I thought I could just change the Bound Column on properties, but the second combo box would not work at all then. I received the following error message on the 2nd combo box that was tied to the first.

"The expression is typed incorrectly, or it is too complex to be evaluated....."
Any suggestions on where to look for my error?


Thanks,
 
Why would you want to save the Name rather than the ID :confused:

Given that the ID represents all the data that relates to that record, if you know the Record ID you can then use a query to find any other piece of information relating to that ID.
 
I sorry I am just not understanding. I have been going through all the examples and there are so many I am getting confused.

I used the example of the two tables and connecting the tables with the Customer ID. Well the combo box worked right in selecting the customer name, which I wanted and I wanted the customer name to go in the main table, but it puts the Customer ID (the number) instead of the name. It will not let me change the Bound column without getting the error message.

On my query I had the following columns

Label Customer Customer ID
Tablelabels Tablelabels Table Customer
Group By Group By Where

Criteria: [Forms]![Form1]![ComboCustomer]


My tables were really simple

Table Customer had two columns: Customer ID and Customer
Tablelabels had four columns: Label ID, Customer ID, Customer, Label

Sorry, I don't know how to insert a copy.

Thanks for your help.
 
You don't need the Customer name in the table, you need the CustomerID.

Your user should not have direct access to the data stored in the tables, all user interaction with that data should happen through the "filter" of a form. In that was you can control what your users sees and how they are able to interact with that data.

Remember that from the CustomerID you can use a query to retrieve any other piece of data related to that ID.
 
Thank you so much for your patience and help! I have finally got the cascading combo boxes working correctly after hours and hours and hours......

I don't know what I would do without the help I receive from the forum.
 

Users who are viewing this thread

Back
Top Bottom