joeserrone
The cat of the cul-de-sac
- Local time
- Today, 10:49
- Joined
- Dec 17, 2006
- Messages
- 164
Hello,
I created a code that when pressing a button everything that is selected in a list box is placed in a text box. But I would like it with the format of "..." or "..." or "..." the current code I wrote doesn't place the " at the beginning and end.
Private Sub Command18_Click()
Dim txtValue As String
Dim varItem As Variant
Dim strlnameselect As String
'Cycle through selected rows in listbox
For Each varItem In Me.Queueselect.ItemsSelected
Select Case Len(txtValue)
Case 0
txtValue = Me.Queueselect.ItemData(varItem)
Case Else
txtValue = txtValue & Chr(34) & " Or " & Chr(34) & Me.Queueselect.ItemData(varItem)
End Select
Next
'Assign variable value to textbox
Me.Queuetorun.Value = txtValue
End Sub
The result is:
04" Or "06" Or "11" Or "18
I need it to show "04" Or "06" Or "11" Or "18"
I created a code that when pressing a button everything that is selected in a list box is placed in a text box. But I would like it with the format of "..." or "..." or "..." the current code I wrote doesn't place the " at the beginning and end.
Private Sub Command18_Click()
Dim txtValue As String
Dim varItem As Variant
Dim strlnameselect As String
'Cycle through selected rows in listbox
For Each varItem In Me.Queueselect.ItemsSelected
Select Case Len(txtValue)
Case 0
txtValue = Me.Queueselect.ItemData(varItem)
Case Else
txtValue = txtValue & Chr(34) & " Or " & Chr(34) & Me.Queueselect.ItemData(varItem)
End Select
Next
'Assign variable value to textbox
Me.Queuetorun.Value = txtValue
End Sub
The result is:
04" Or "06" Or "11" Or "18
I need it to show "04" Or "06" Or "11" Or "18"