D
Dave
I have 2 listboxes
Listbox2 is where the user selects the items that want to use (1 column)
extended listbox
ListBox4 is where the selected items are shown (1 column) extended listbox
I am using the additem method to populate listbox4 with the selected items
from listbox2
The problem I have run into is Listbox2 may have a value with a comma such as
"CABLE, TWISTED SHIELD 100 OHM"
when I use the additem method in listbox4 which must have the value field in
rowSourceType it breaks the value up from listbox2 into 2 seperate entries
such as
CABLE
TWISTED SHIELD 100 OHM
How do I prevent this from happening. Example Code Appreciated
Thanks in Advance
Dave
Code I am using:
Dim ctrlListBox As ListBox
Dim FRM As Form, CTl As Control
Dim varitem As Variant
Dim strSQL As String
Set FRM = Forms![FilterbyAccount/Description]
Set CTl = FRM!List2
Dim Db As Database
Set Db = CurrentDb
Set ctrlListBox = FRM!List4
'populate values in listbox4
For Each varitem In CTl.ItemsSelected
ctrlListBox.AddItem Item:=CTl.ItemData(varitem)
Next
'clears selected values in listbox2
For Each varitem In CTl.ItemsSelected
CTl.Selected(varitem) = False
Next varitem
Listbox2 is where the user selects the items that want to use (1 column)
extended listbox
ListBox4 is where the selected items are shown (1 column) extended listbox
I am using the additem method to populate listbox4 with the selected items
from listbox2
The problem I have run into is Listbox2 may have a value with a comma such as
"CABLE, TWISTED SHIELD 100 OHM"
when I use the additem method in listbox4 which must have the value field in
rowSourceType it breaks the value up from listbox2 into 2 seperate entries
such as
CABLE
TWISTED SHIELD 100 OHM
How do I prevent this from happening. Example Code Appreciated
Thanks in Advance
Dave
Code I am using:
Dim ctrlListBox As ListBox
Dim FRM As Form, CTl As Control
Dim varitem As Variant
Dim strSQL As String
Set FRM = Forms![FilterbyAccount/Description]
Set CTl = FRM!List2
Dim Db As Database
Set Db = CurrentDb
Set ctrlListBox = FRM!List4
'populate values in listbox4
For Each varitem In CTl.ItemsSelected
ctrlListBox.AddItem Item:=CTl.ItemData(varitem)
Next
'clears selected values in listbox2
For Each varitem In CTl.ItemsSelected
CTl.Selected(varitem) = False
Next varitem