I have read all the posts showing the following...
Replace(strText,"'", "''"
It isn't helping me.
Now I get...
SELECT * FROM qryDonationSearchOutput WHERE dtmemorialFor LIKE 'D''Andrea*' ORDER BY donationID DESC
Of course I get no results, because that search string can't find D'Andrea.
How do I get my search string to work?
The following is the 'Naked Code'
Daniel Dillon
Replace(strText,"'", "''"
It isn't helping me.
Now I get...
SELECT * FROM qryDonationSearchOutput WHERE dtmemorialFor LIKE 'D''Andrea*' ORDER BY donationID DESC
Of course I get no results, because that search string can't find D'Andrea.
How do I get my search string to work?
The following is the 'Naked Code'
Code:
If Me.txtMemoriam <> "" Then
SQLtxtMemoriam = SQLtxtMemoriam & "("
For counter = 0 To (upperLim - 1)
MsgBox txtArray(counter)
If txtArray(counter) <> "" Then
SQLtxtMemoriam = SQLtxtMemoriam & "(dtmemorialFor LIKE '" & txtArray(counter)
End If
If Right(Me!txtMemoriam, 1) = "*" Then
SQLtxtMemoriam = SQLtxtMemoriam & "') OR "
Else
SQLtxtMemoriam = SQLtxtMemoriam & "*" & "') OR "
End If
Next
SQLtxtMemoriam = SQLtxtMemoriam & "(dtmemorialFor LIKE '" & txtArray(counter)
If Right(Me!txtMemoriam, 1) = "*" Then
SQLtxtMemoriam = SQLtxtMemoriam & "')"
Else
SQLtxtMemoriam = SQLtxtMemoriam & "*" & "')"
End If
SQLtxtMemoriam = SQLtxtMemoriam & ")"
End If
sSQLWhere = sSQLWhere & "donationID IN (SELECT dtmemorial_FdonationID FROM tblDtMemorial WHERE " & SQLtxtMemoriam & ")"
' MsgBox SQLtxtMemoriam & vbCrLf & vbCrLf & _
'' sSQLWhere
' Exit Sub
End If
Daniel Dillon