I have a search form which searches a table for employee records. To keep it simply I am trying to get it to work only on the surname textbox at the moment. To do this I have a global string that has the 'WHERE' part of the SQL statement stored in it. It goes something like this:
Set rcd = db.OpenRecordset("SELECT * " & _
"FROM tblEmployees " & _
"WHERE " & gstrEmployeeSearch & ";")
rcd is the recordset variable and db is obviously the database variable.
When the search is performed the variable value at this stage is simply:
gstrEmployeeSearch = "[LastName] Like " _
& Chr$(34) & Me![txtLastName] & "*" & Chr(34)
The error message I am receiving is 'Type Mismatch' Unfortunately the help facility wasn't much help! I hope one of you lot will be!!
Thanks all
Mark
Set rcd = db.OpenRecordset("SELECT * " & _
"FROM tblEmployees " & _
"WHERE " & gstrEmployeeSearch & ";")
rcd is the recordset variable and db is obviously the database variable.
When the search is performed the variable value at this stage is simply:
gstrEmployeeSearch = "[LastName] Like " _
& Chr$(34) & Me![txtLastName] & "*" & Chr(34)
The error message I am receiving is 'Type Mismatch' Unfortunately the help facility wasn't much help! I hope one of you lot will be!!
Thanks all
Mark