To make this Injection-proof, simply add the following code after line #5 :
PS. Alternatively, you may decide simply to strip out any quote characters and pass that string along, instead of advertising that your code is on to them ;)
Code:
Dim strCheck As String
If Replace(Replace(Forms!frmMain![txtSearch], _
"""", _
""), _
"'", _
"") <> Forms!frmMain![txtSearch] Then
'Handle SQL Injection here
End If
Comment