Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combox box won't allow bound column set to 2

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have a combo box and have two columns
ID and task
1 ShipItem
2 SellItem
3 BoughItem

I have the bound column set to 2. I want to see SellItem if I choose the second one from above
But I see a number 2 in the box not the word SellItem

How can I make it show "SellItem" instead?
We want to be able to key a number 1 to 3 but see the words ShipItem, SellItem or BoughItem.


DougP, MCP, A+
 
This is not done with the Bound Column. The Bound Column is what is written to the table (if there is one) and what the combo is equal to. To display the second column, set Column Widths (Format tab):
0;2.5;0
0;2.5;1
Or so on. A Column Width set to zero is hidden.
 
What is the RowSource of your combobox?

Let them hate - so long as they fear... Lucius Accius
 
Remou, That's the tricky part, if I set the column to 0 then no number shows up at all.
They would like to pick a number from 1 to 3 but see the words
There are actually 84 items in the list not just 3. I used 3 in this post to simply things. So they would like to key in a number from 1 to 84

straybullet,
row source = Value list
1;ShipItem;2;SellItem;3;BoughItem


DougP, MCP, A+
 
That is very tricky indeed. As far as I recall from a previous discussion, it is not possible. Would they be satisfied with the name/description showing in a text box? For example:

[tt]=Me.cboCombo.Column(1)[/tt]
 
how are ya DougP . . .

Its not as bad as it seems!

The [blue]column displayed[/blue] in the dropdown list as well as whats stored ith textbox portion of the combo, is [blue]determined by the first non-zero width field[/blue] in the [blue]Column Widths[/blue] property ([purple]regardless of the Bound Column property![/purple]) . . .

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Aceman,

I think you missed my post dated 2 Jan 07 16:16 and DougP's reply dated 2 Jan 07 16:49



 
If you have 83 possibilities, you may want to use a table with the choices, in which case you can link the tables, and choose to display the Look-Up info (the description) instead of the linking field (the #).
 
I was thinking along those lines as well - 83+ items in a value list seems a bit much and can't possibly be simple to edit when necessary...

Let them hate - so long as they fear... Lucius Accius
 
Doug, Let me make sure I understand. In the combo box you want the user to see both the ID and that task but after the selection is made you only want the Task to show in the field? If that is correct then just reverse the two columns. Put the task first then the ID. It may not look as nice as you would like but it does provide a solution. Just a thought.
 
pryest, yes you are correct, That's the way I have it now
but he users find it easier to remember a number and key it in than the first few ltters of the item. Go figure.
I tried a bunch of stuff much of which took a few hours to re configure. One of which was to add another text box and shove the item description in it and have the number show in the combo box.

So I have told them to use it the way it is for now.
Thanks all for your help.

DougP, MCP, A+
 
And what about this ?
Row source:
1;1 - ShipItem;2;2 - SellItem;3;3 - BoughItem

Column Widths:
0;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I have the same issue. I have a lookup table - first column Codes, Second = Long Names. Everyone knows the codes - or at least they are easy to enter - you start to enter the first letter then go to drop down list - very quick data entry method (with over 1000 codes!). But then the whole name needs to display and be in the underlying form. It's both and error checking method (some codes are so similar that one mistype gets you the wrong name - so when the long name displays you know you entered the corect code). Then the long name needs to be in the underlying table (clients requirement - or I'd use the code and simply have a display text box show the long name for instant error checking).

Don't know exactly why this works, but....

Put in an afterupdate event procedure:

If Len([DominantVEG1]) < 6 Then
Me![DominantVEG1] = Me![DominantVEG1].Column(1)

Substitute your field name for DominantVEG1

Don't know why the Me![DominantVEG1].Column(1) actually puts Column 2 (the long name) into the display, but it does.

Worked on this for a couple days last year!
 
Don't know why the Me![DominantVEG1].Column(1) actually puts Column 2
Just because the index numbering of the Column property start at zero ...
 
Hmm, That's odd. Thanks. I think I used to know that at one time. Could be better documented!

So Displaying columns starts at one, but indexing starts at zero.
 
I have a similar issue. I have a table with ID and Ethnicity and have a combo box on my form where I'd like the user to see the text ethnicity to select from, but then have the number value associated with it pushed into the table. How would I do that?
 
LOKIDOG said:
Could be better documented!
No F1 key on your keyboard ?
Simply press it with the cursor inside the Column word ...
 
DougP . . .

If you set bound column to zero and in the [blue]Column Widths[/blue] property set the width so [blue]ID[/blue] shows, your problem should be solved. The Id wil be saved as well as being displayed in the [blue]Textbox[/blue] portion of the combo!

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top