|
-
Jul 13th, 2006, 11:07 PM
#1
Thread Starter
Junior Member
[Resolved]Quick Question regarding Combo boxes & Listboxes
I know from my VB6 days that when I am populating combo boxes (or listboxes), I could assign the ItemData property to store typically the ID number associated with the text selection.
In VBA, this ItemData is not available. How do I do this in VBA? I'm building this in excel if that makes a difference....
example:
VB Code:
For iCounter = 0 To UBound(arrProvinceState, 2)
Me.cboProvState.AddItem arrProvinceState(1, iCounter)
Me.cboProvState.ItemData(cboProvState.NewIndex) = arrProvinceState(0, iCounter)
Next iCounter
I'd really appreciate any help regarding this.
Thanks in advance!
Last edited by whiteGSR; Jul 18th, 2006 at 02:45 AM.
-
Jul 14th, 2006, 09:38 AM
#2
Re: Quick Question regarding Combo boxes & Listboxes
Welcome to the Forums!
You can change the number of columns in the control to 2, storing the ID in Col1 and the text in Col2. Then make the first column invisible by changing the ColumnWidths property of the control.
In my post here , there is an example of adding data to a 2 column control.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Jul 18th, 2006, 02:45 AM
#3
Thread Starter
Junior Member
Re: Quick Question regarding Combo boxes & Listboxes
 Originally Posted by DKenny
Welcome to the Forums!
You can change the number of columns in the control to 2, storing the ID in Col1 and the text in Col2. Then make the first column invisible by changing the ColumnWidths property of the control.
In my post here , there is an example of adding data to a 2 column control.
awesome, that worked flawlessly
thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|