Hi all,
I have the following code on the "on-click" event of a listbox which populates a textbox:-
Now, what I need is a kind of reverse. The listbox will already have pre-defined values, but I need specific ones highlighted based on the comma-delimited values from the textbox.
I have something like this at the moment, but not sure what I need to add:-
Many thanks in advance.
I have the following code on the "on-click" event of a listbox which populates a textbox:-
Code:
Dim strSelected As String
Dim varItem As Variant
With Me.lstClientCodes
For Each varItem In .ItemsSelected
strSelected = strSelected & "," & .ItemData(varItem)
Next varItem
Me.txtCodeString = Mid(strSelected, 2)
End With
Now, what I need is a kind of reverse. The listbox will already have pre-defined values, but I need specific ones highlighted based on the comma-delimited values from the textbox.
I have something like this at the moment, but not sure what I need to add:-
Code:
myArray = Split(Forms![frm_NewCode]![txt_CodeString], ",")
For i = LBound(myArray) To UBound(myArray)
[COLOR="Red"][B]''' listbox to populate I presume[/B][/COLOR]
Next
Many thanks in advance.