I have a multi-select listbox (lstValues) and I am using the ItemsSelected property to return the values selected in the list in a message box. The items selected in the list are: Apples, Oranges, Grapes. My message box displays it as: or Apples or Oranges or Grapes
I want my message box to display it as follows: "Apples" or "Oranges" or "Grapes" How can I get it to display like that. Below is the code I currently have:
I want my message box to display it as follows: "Apples" or "Oranges" or "Grapes" How can I get it to display like that. Below is the code I currently have:
Code:
Dim frm As Form, ctl As Control
Dim varItm As Variant
Dim x As Variant
Set frm = Form_Form1
Set ctl = frm!lstValue
For Each varItm In ctl.ItemsSelected
x = x & " Or " & ctl.ItemData(varItm)
Next varItm
MsgBox x