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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is is poss for a 3 columns Combo/ List box

Status
Not open for further replies.

firthr

Programmer
Oct 27, 2000
6
GB
Hi,
I really want to know whether VB, like Access, can produce a combo box with more than 1 column to it. My task at hand is to have a list box of severity numbers and next to that severity descriptions so that users know they are selecting the right one when they select the number .

Is that poss, or are there better ways maybe?

Thanks,
Rob
 
sure can

email me

drat@mediaone.net

I'll show you how

:)

Ratman
 
If the descriptions are unique, use the AddItem method of the control to add the descriptions to the list, and use the ItemData property (populated by using the NewIndex method) of the control to add the number.

When a user selects a description, get the index of the item selected and then use List1.ItemDate(Index) to get the number.

Simon
 
hey ratman,
any chance of documenting your suggested solution here?
cheers
m
Mark Saunders
:)
 
In Excel......

1. Put a ComboBox from the Control Toolbox Toolbar on your worksheet.

2. Click on the Design Mode button so you can select the ComboBox

3. RightClick on the ComboBox and select properties

4. set Bound Column to 0 for indexing only or set it to the numbered column you want to return selected event. 1 is good.

5. set ColumnCount to the number of columns you want to view

6. set the LinkedCell to a cell on your sheet.....on click it will list the index # you clicked on if Bound Column 0

7. set ListFillRange accordingly...ex.(Sheet2!A1:G20 will give you a 7 column ComboBox.....heheheh.....I have a 64 column one at work....hehehe..this can also be an array name.

All these properties and more can be set via VB.
Depends if you want to attach one via VB or just modify a few properties.......best just to play around.
 
thanks, is it possible to do something very similar in vb? possibly populating the combobox from a recordset?
cheers
mark
Mark Saunders
:)
 
not really a full answer to your question but I gotta sleep sometime....hehehehe....it's just a very small sample

'ActiveSheet.Shapes("List Box 23").Select
'Selection.Locked = False
'With Selection
'.ListFillRange = "Sheet1!$C$1:$C$" & lastcustomerrow
'.LinkedCell = "Sheet2!$M$1"
'.MultiSelect = xlNone
'.Display3DShading = True
' End With

 
Could you not just add the number (index) in front of the description in the Text for each item in the combo box?

i.e. the text for each item would be:

1 Slight problem
2 Major problem
3 Totally Screwed

No need for more than one column then ...

Madlarry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top