I have a variable (string) in which I store the users selection from a listbox on a form. The user is allowed to make multiple selections, so the content of the variable could look like '1' (only one selection) or '1,3' (more selections.
On an other form I which to have a listbox with the same values, and as a default the same items should be selected as was the case on the other form.
My idea is to loop through the items in the list (see below) and chech if they are part of the variable. But the last bit is causing me some trouble.
How could/should my if sentence look? Do I need to split the variable and loop through those values as well?
On an other form I which to have a listbox with the same values, and as a default the same items should be selected as was the case on the other form.
My idea is to loop through the items in the list (see below) and chech if they are part of the variable. But the last bit is causing me some trouble.
Code:
For i = 0 to Me.lstStatus.ListCount - 1
'If list item is part of variable
Me.lstStatus.Selected(i)
End if
Next i
How could/should my if sentence look? Do I need to split the variable and loop through those values as well?