Combo Box Question

sparklegrrl

Registered User.
Local time
Today, 22:09
Joined
Jul 10, 2003
Messages
124
I have a combo box on a form that drop down a list of shipping destinations for the cars at our shop.

The drop down list contains the customer, destination and route however when I select it it only displays the customer name.

How do I get the box to display all of the columns once it has been selected?
 
Go into design view and inspect the properties for the combo. Make sure that you have three columns selected in the Column Count row. Make sure that the width of each column is sufficient for the field to display properly. If 0 is selected the field won't show. Inspect the row source to ensure that the three fields you want are included in the query.
 
I don't think there is a way to actually display multiple columns once you have chosen a value... atleast not that I have ever found.

What I do in the case that I want a user to see more of the columns is I put locked and not enabled text boxes that are controlled by the various columns in the combo box. Once a value is chosen in the combo box, the other fields' displays are updated to show the various columns. It's not the ideal solution, but unless someone has a better one, that is what I do.

Hope that helps,

Marco
 
Ancient One: Going to try that now...thanks!

Mlopes: That would work fine for me too but I'm a newbie using Access 2000 and not quite sure how to make the text box do that. I'd love to find out though because that would be extremely useful for me in tracking invoices, etc.
 
AncientOne said:
Go into design view and inspect the properties for the combo. Make sure that you have three columns selected in the Column Count row. Make sure that the width of each column is sufficient for the field to display properly. If 0 is selected the field won't show. Inspect the row source to ensure that the three fields you want are included in the query.

Didn't work, it's still only showing the 1st column.
 
In case you choose this method here's how I do it:

ComboBox1 with fields Cust, Dest, Route.

Add three text fields. Under properties<>Data, set each one's control source to Cust, Dest, and Route respectively. Now go under the Format tab and change their Enabled property to False and their Locked Property to True.

Now, when you select a value from the combo box, you should see the three text boxes fill in with the appropriate data. You can adjust how many text boxes you have up or down, just follow the same logic.

Let me know if something wasn't clear!

Marco
 
Forgot one part:

Under ComboBox1's AfterUpdate event enter code that says something like:

Me.TextField1 = Me![ComboBox1].Column(0)
Me.TextField2 = Me![ComboBox1].Column(1)
Me.TextField3 = Me![ComboBox1].Column(2)


Substituting TextField# with whatever you named them and the column numbers if necessary.
 
You can of course also combine all three fields in the combos underlying query and just hide the key field
 
Use the combo wizard! It will ask you what fields you want to display and let you size them!
 
can we get this straight?

You have a combo box.
It has 3 columns.
all the columns display in the drop-down list.
When the selection is made, you want all three columns to appear in the combo box window, not just one?

Let's assume this is the scenario for what you want.


Your combo box is currently based on a table or a query. The table or query is called the ROW SOURCE of the combo.

Only one field from the row source can be displayed in a combo. Therefore you have to concatenate (join together) fields in an underlying query to display them all at one time.

Presumably, you are also using one field from the underlying query to do something like open a particular record and display it on a form. This is usually the Primary key field of the record.

Because the combo uses the key field to carry out the business of opening the form,etc, the key field is called the BOUND COLUMN of the combo. But key fields are usually unfriendly numbers or groups of alphanumeric codes. The user doesn't want to see them.

General practice is thus to hide the key column by giving it a width of 0 in the properties list and to display the associated data(Customer, Destination and Route in your case). You can have as many columns as you like displayed in the drop-down list, but once the selection is made only one of the columns can be displayed as I have described.

I have attached a db for you. The combo box on form 1 hides the key column called MyPrimaryKey, but still uses it to open FrmAll to display the record you choose.

The combo shows you all your fields plus an additional joined field from an expression in the underlying query, Query1. When you make your choice, the joined field appears in the combo window, the other fields disappear and the Bound column is used to display the appropriate record on another form..
 

Attachments

Yes, Ancient One...that is EXACTLY what I am trying to do. Thank you so much for the explanation.

I am having trouble getting the query set up. I have added the joined column to the query.....but what makes it actually join them?

I created a query and added a joined column to it but now the form asks me to enter a joined value when I click on the drop down arrow.
 
I GOT IT! WOHOO! I GOT IT!!!

I put this expression in the query:
Expr1: [BillTo] & " " & [Attention] & " " & [Address] & " " & [City/State] & " " & [Zip]

Now.....this SHOULD be a simple question...ho do I insert commas in there to separate the fields?
 
WELL DONE:D

Just put you commas inside the quotes to show they are literal characters.


Expr1: [BillTo] & " , " & [Attention] & " , " & [Address] & " , " & [City/State] & " ," & [Zip]


Ignore my post about relationships I was using Joined fields in my original advice to avoid using "concatenation", which is the correct term for gluing fields together!
 
Last edited:
Thank you SO VERY MUCH!

I'd give ya a big squishy hug if I could!!!
 

Users who are viewing this thread

Back
Top Bottom