Combo Box Data from another Combo Box

Accessosaurusrex

Registered User.
Local time
Today, 03:46
Joined
Oct 18, 2010
Messages
28
I have read through the forums and followed the data but cannot seem to make a simple daisychain. I have a single table (bcone) with 13 fields (job, customer, description, etc.). I simply want to allow a user to enter data in the first combo box (Job) using the drop down or typing in the data which then limits the results to the next combo box (Customer) to customers only as related to Job and so forth. When the user is done I want to click a "go" button and preview a report that I have generated based on the combo box inputs.

Using MS Office and a variety of different sources has me on the form with the combo boxes for the fields. It does not work at this time and the SQL information uses "HAVING" in lieu of "WHERE" as some of the forums has stated. If I change it to "WHERE" then I am missing an operator.

This is my current SQL for the query but I feel I am going the wrong way:

SELECT Bcone.Job, Bcone.Customer
FROM Bcone
GROUP BY Bcone.Job, Bcone.Customer
HAVING (((Bcone.Customer)=Forms!SearchForm1!Combo1));

I have downloaded several samples and like the way they work but with my limited ability I have been unable to accomplish this. If there is an easier way to do this please let me know.

Thanks!
 
What you are looking for is a cascading combo box set.

However you mention that you have only one table with 13 fields :eek: this sounds like a very de-normalised table structure. You might find your task a whole lot easier once you have rectified this problem.
 
Thank you for your assistance, it was very informative. I would like to ask a couple more questions and then should be well on my way. I have attached a copy of the database in question to help explain.

The problem I have now is that it displays the same value numerous times in the next combo box. For example if you select 11111 in the Job box (cboText0), you can see zzz several times in the customer (cboCombo2) drop down. I played with the SELECT DISTINCT function but was unsuccessful. What am I missing to allow me to select a value for the second combo box and get a unique only list from the combo box? Additionally is there anything I can do about the default value of the secondary combo box to blank it each time a change is made to a previous combo box?

Also, I just wanted to verify that once this is worked out, should I choose to add more combo boxes for some of the other fields, all I need to do is repeat the process for each additional item right?

Thanks a million for your assistance. I cannot say thanks enough for helping newbies as we learn!
 

Attachments

Last edited:
As I mentioned in my previous post you really need to normalise your Table structure, before you can progress with this project. Once you have done that this task will be a lot more straight forward.
 

Users who are viewing this thread

Back
Top Bottom