We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Function WhereLikeString() As String 'If there is more than one item in the listbox, then need to create like strings for each item 'in the list box as a parameter to the sql statement Dim i As Integer Dim strWhere As String Dim strArray() As String For i = 0 To lstMerchants.ListCount - 1 ReDim Preserve strArray(i) strArray(i) = lstMerchants.ItemData(i) strWhere = strWhere & "GLMerchant Like '" & strArray(i) & "' OR " Debug.Print strWhere Next i WhereLikeString = " AND " & Left(strWhere, Len(strWhere) - 4) Debug.Print WhereLikeString End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.