Solved

multi column ComboBox

Posted on 2000-03-14
8
349 Views
Last Modified: 2012-05-04
Is there an easy way to create a multi columns datacombobox or to link the item selected with an other field

eg:

these values are in a table

id   label
-----------
1  |  man
2  |  Woman
3  |  Martian

the value 1,2,3 are listed in the dropdown combo, when I select 2, woman is printed in a textbox; I'd like to do this without having so create a query (it would be too easy :-))

thanks...
0
Comment
Question by:Pleinpopossum
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2616156
The easiest way is to concatenate the 2 fields in your Select query (Select Id + ' - ' + Label AS FieldToDisplay From Table1) and bind the new field to the DataCombo.
0
 

Author Comment

by:Pleinpopossum
ID: 2616193
Thank you very much emoreau. The idea is not so bad but the label is just to make the user to ensure he chose the right code. I already thought to this solution. So... I can't use it this way because I would need to isolate the code from the label for other ops... So I'd prefer a solution which would modify the value in the textbox when I change the value in the combo.

Xav.
0
 
LVL 4

Expert Comment

by:vindevogel
ID: 2616237
Standard functionality of the Sheridan grid / combobox (www.shersoft.com)
(Datawidgets)

You have 3 ways of adding data there.
Bound, Unbound or ADDITEM
In the additem, you can add whatever you want, multicolumn, ... It's reacting afterwards just like it came from a query.

Check the properties BoundText, BoundColumn and ListField ....
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Expert Comment

by:pinshah
ID: 2616269
Bound both the combo and the Text box with same recordset.
0
 
LVL 1

Accepted Solution

by:
ndb earned 100 total points
ID: 2616367
You can also do this with the Microsoft Forms 2.0 controls.
You can bound these controls too.
I use it because I also have a text that is shown to the user in the combobox and an index that doesn't appear to the user.
0
 
LVL 2

Expert Comment

by:damienm
ID: 2616373
If you have 2 combo boxes, I visible and 1 invisible, the second containing label, then when you select item 1 from combo1 set the textbox = the corresponding item in the list from combo2
0
 

Expert Comment

by:ckhlam
ID: 2618294
Try to use combo box to keep the id and array to keep the labels.  Whenever you click a item on combo box,

txtLabel = aryLabel(cboID.listindex)

Then the label value can be printed on the text box.
0
 

Author Comment

by:Pleinpopossum
ID: 2618784
The idea is good but I'm looking for a "natural" solution. In fact the main problem is that the combo has to be linked with a database. It means I'd better to use a datacombo. Thanks to ndb I discovered the Krosoft forms controls 2. It doesn't exactly reply to my problem but it helped me for other problem.

Thanks a lot for trying to help me.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Specify ip address in my connection string for sas 2 65
Copy a row 12 64
SLMGR Switches Are Not Working On KMS Host 3 110
MS SQL Update query with connected table data 3 38
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question