Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the data I have and nothing is added when I click Addtolist and don't understand why? Any help?

VB
Private Sub Addtolist_Click()
    vol_my_worked_hrs.RowSource = vol_my_worked_hrs.RowSource & MyText1 & MyText2 & ";"
End Sub


combo box converted to list box : vol_my_worked_hrs

What I have tried:

I do have
a) listbox with row source = Value List
b) 2 columns
c) property 'Allow Value List Edits' set to Yes
d) listbox name is 'vol_my_worked_hrs'
me.vol_my_worked_hrs.AddItem me.MyText1
me.vol_my_worked_hrs.AddItem me.MyText2
Posted
Updated 25-Apr-18 5:22am
v4

1 solution

When ListBox.RowSource is set to ValueList, the only way to add new item to multicolumn ListBox is to separate each column with semicolon (or comma - it depends on settings):
VB
me.vol_my_worked_hrs.AddItem me.MyText1 & ";" & me.MyText2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900