What am I doing wrong with this?
searchArray = split(Recordset1__MMColParam, " ")
Build the sql string
Do while x <= UBound(searchArray)
If x < Ubound(searchArray) Then
strSQL = strSQL & "num = '" & trim(searchArray(x)) & "', "
Else
strSQL = strSQL & "num = '" & trim(searchArray(x)) & "'"
End If
x = x + 1
Loop
myVar1 = searchArray(0)
myVar2 = searchArray(1)
myVar3 = searchArray(2)
myVar4 = searchArray(3)
strSql="SELECT KB_ID, KB_Title, KB_Error_Msg, KB_Keywords, KB_Date, KB_Sum " & "FROM Tbl_KB WHERE KB_Keywords IN " _
'& ('" & myVar1 & "','" & myVar2 & "','" & "','" & myVar3 _
'& "','" & myVar4 & "')"
************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->
searchArray = split(Recordset1__MMColParam, " ")
Build the sql string
Do while x <= UBound(searchArray)
If x < Ubound(searchArray) Then
strSQL = strSQL & "num = '" & trim(searchArray(x)) & "', "
Else
strSQL = strSQL & "num = '" & trim(searchArray(x)) & "'"
End If
x = x + 1
Loop
myVar1 = searchArray(0)
myVar2 = searchArray(1)
myVar3 = searchArray(2)
myVar4 = searchArray(3)
strSql="SELECT KB_ID, KB_Title, KB_Error_Msg, KB_Keywords, KB_Date, KB_Sum " & "FROM Tbl_KB WHERE KB_Keywords IN " _
'& ('" & myVar1 & "','" & myVar2 & "','" & "','" & myVar3 _
'& "','" & myVar4 & "')"
************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->