joeserrone
The cat of the cul-de-sac
- Local time
- Today, 01:25
- Joined
- Dec 17, 2006
- Messages
- 164
Hello everyone I have the following code listed below. I need to be able to have a " and the beginning and ending of every item is selected in a muti-select listbox. so for example if a user selects Balance and Capture in the list box. This code right now populates a text box I am using for a query criteria with: Balance or Capture
How can I get it to produce "Balance" or "Capture"
Dim lngLoop As Long
Dim strIDs As String
If ListCategoryEdit.ItemsSelected.Count > 0 Then
strIDs = ""
For lngLoop = 0 To ListCategoryEdit.ItemsSelected.Count - 1
strIDs = strIDs & "" & ListCategoryEdit.ItemData(ListCategoryEdit.ItemsSelected(lngLoop)) & " OR "
Next lngLoop
strIDs = Left(strIDs, Len(strIDs) - 4)
txtQueryCriteria = strIDs
DoCmd.OpenQuery "EditQuery"
Else
txtQueryCriteria = ""
MsgBox "No names are selected!", vbExclamation
End If
How can I get it to produce "Balance" or "Capture"
Dim lngLoop As Long
Dim strIDs As String
If ListCategoryEdit.ItemsSelected.Count > 0 Then
strIDs = ""
For lngLoop = 0 To ListCategoryEdit.ItemsSelected.Count - 1
strIDs = strIDs & "" & ListCategoryEdit.ItemData(ListCategoryEdit.ItemsSelected(lngLoop)) & " OR "
Next lngLoop
strIDs = Left(strIDs, Len(strIDs) - 4)
txtQueryCriteria = strIDs
DoCmd.OpenQuery "EditQuery"
Else
txtQueryCriteria = ""
MsgBox "No names are selected!", vbExclamation
End If