Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox ItemData
Do comboboxes in Excel have an ItemData? I'm populating a combobox fro
a database and need to tie the record's UID to what's displayed in th box. Do I have to use multiple columns in the combobox to do this? And jus hide that column maybe? I know VBA pretty well, just have never used it in Excel before. Thanks -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox ItemData
Do comboboxes in Excel have an ItemData? I'm populating a combobox from
a database and need to tie the record's UID to what's displayed in the box. No. Unfortunately MSForms combo box controls lack this feature. Do I have to use multiple columns in the combobox to do this? And just hide that column maybe? That's the easiest way to accomplish the same thing. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox ItemData
Thank you, Rob.
For some reason I didn't get notified by email when you posted this, s I didn't see it until I checked the post just now. So I'm taking the route of using multiple columns. When looping throug a recordset to populate the combobox, how do I refer to a specifi column? Here's what I tried: UserForm1.cboAccount.ColumnCount = 2 UserForm1.cboAccount.ColumnWidths = "2,0" Do Until rs.EOF UserForm1.cboAccount.column(0) = rs!acct_name UserForm1.cboAccount.column(1) = rs!acct_id 'UserForm1.cboAccount.ListIndex = rs!acct_id rs.MoveNext Loop But I think that's only for loading arrays. Is there a simple way t load the two columns for each line? Thanks -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox ItemData
Okay- disregard that last question. I figured it out:
Do Until rs.EOF With UserForm1.cboAccount .AddItem rs!acct_name .List(.ListCount - 1, 1) = rs!acct_id End With rs.MoveNext Loop Thanks -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox ItemData
Okay- disregard that last question. I figured it out:
Do Until rs.EOF With UserForm1.cboAccount .AddItem rs!acct_name .List(.ListCount - 1, 1) = rs!acct_id End With rs.MoveNext Loop Thanks -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
COMBOBOX | New Users to Excel | |||
VBA ComboBox | Excel Programming | |||
combobox | Excel Programming | |||
Combobox | Excel Programming |