howdy folks,
i'm having trouble coming up with the correct syntax for a SQL statement that i'm passing to an ADO recordset. i'm trying to use a text box on a form to pass a "keyword search" value to create a ADO recordset using the LIKE function. i then loop through the ADO recordset to populate a MS ListView ActiveX control.
i think i'm getting all messed up with the quotes in quotes stuff. i've tried the following variations:
sSQL2 = "SELECT A, B, C, D, E FROM tblHAPList WHERE D LIKE" & "'*'&" & "'" & Me.txtKeyword & "'" & "&'*'"
sSQL2 = "SELECT A, B, C, D, E FROM tblHAPList WHERE D LIKE" & "'*'" & Me.txtKeyword & "'*'"
neither worked correctly however when i hard code the WHERE clause i can get it to work. the error i receive states:
"Runtime error 3021: Either BOF or EOF is true, or current record has been deleted. Requested operation requires a current record"
Any help with this problem would be greatly appreciated.
many thanks.
i'm having trouble coming up with the correct syntax for a SQL statement that i'm passing to an ADO recordset. i'm trying to use a text box on a form to pass a "keyword search" value to create a ADO recordset using the LIKE function. i then loop through the ADO recordset to populate a MS ListView ActiveX control.
i think i'm getting all messed up with the quotes in quotes stuff. i've tried the following variations:
sSQL2 = "SELECT A, B, C, D, E FROM tblHAPList WHERE D LIKE" & "'*'&" & "'" & Me.txtKeyword & "'" & "&'*'"
sSQL2 = "SELECT A, B, C, D, E FROM tblHAPList WHERE D LIKE" & "'*'" & Me.txtKeyword & "'*'"
neither worked correctly however when i hard code the WHERE clause i can get it to work. the error i receive states:
"Runtime error 3021: Either BOF or EOF is true, or current record has been deleted. Requested operation requires a current record"
Any help with this problem would be greatly appreciated.
many thanks.