mickmullen
Registered User.
- Local time
- Yesterday, 22:27
- Joined
- Oct 30, 2018
- Messages
- 19
I'm looking to build a string in VBA
I have successfully implemented code using Listbox.itemsSelected
However, I am now trying to build a string that uses all of the items in the list box, when none are selected. I am having trouble locating what property I should be using
For Each varItem In Me!ListRmNum.(??Each Item in the List??)
I'm not sure that varitem is used correctly here. looking to build a string of all items in the list box
Similar to this, but I want all items returned rather then just the selected (Note- in this scenario, no items will be selected)
I have successfully implemented code using Listbox.itemsSelected
However, I am now trying to build a string that uses all of the items in the list box, when none are selected. I am having trouble locating what property I should be using
For Each varItem In Me!ListRmNum.(??Each Item in the List??)
I'm not sure that varitem is used correctly here. looking to build a string of all items in the list box
Similar to this, but I want all items returned rather then just the selected (Note- in this scenario, no items will be selected)
Code:
For Each varItem In Me!ListRmNum.ItemsSelected
'add the chkExclude checkbox
If (Me!chkExcludeRoom = False) Then
strCriteria = strCriteria & "[Estimate Data.room Number] = " & Chr(34) _
& Me!ListRmNum.ItemData(varItem) & Chr(34) & " OR "
Else
strCriteria = strCriteria & "[Estimate Data.room Number] <> " & Chr(34) _
& Me!ListRmNum.ItemData(varItem) & Chr(34) & " AND "
End If
Next varItem