joeserrone
The cat of the cul-de-sac
- Local time
- Today, 01:48
- Joined
- Dec 17, 2006
- Messages
- 164
I currently have the following code listed below behind a multi-select list box that creates a string and places it on a text box that I am trying to use for a query criteria. After the string loops I want to be able to trim the last 4 character. My Results right now are like this:
Balance OR Balance Recovery OR
I want them to appear in my text box like this:
Balance OR Balance Recovery
---------------------------------------------------------
Private Sub Command45_Click()
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
txtQueryCriteria = strIDs
DoCmd.OpenQuery "EditQuery"
Else
txtQueryCriteria = ""
MsgBox "No names are selected!", vbExclamation
End If
End Sub
Balance OR Balance Recovery OR
I want them to appear in my text box like this:
Balance OR Balance Recovery
---------------------------------------------------------
Private Sub Command45_Click()
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
txtQueryCriteria = strIDs
DoCmd.OpenQuery "EditQuery"
Else
txtQueryCriteria = ""
MsgBox "No names are selected!", vbExclamation
End If
End Sub