I am getting a "Run-time error 13 - Type mismatch" on the following statement.
Here are the other lines of codes:
EmpID is defined as a text field in the table PiecePay. Since EmpIDHold is defined as a string, I don't know how that could cause the mismatch. Do I have any of my quotes wrong in the select statement? Is there anything wrong with the Set statement? I want to edit the record if it is found. If it is not found, I will add it.
EmpIDHold has the value "1987" when the error occurs.
Thanks for any help.
Code:
Set rs2 = db2.OpenRecordset(vSql, dbOpenDynaset, dbSeeChanges)
Here are the other lines of codes:
Code:
Dim EmpIDHold As String
Dim db2 As Database
Dim rs2 As Recordset
Dim vSql As String
Set db2 = CurrentDb
vSql = "Select * From PiecePay Where EmpID =' EmpIDHold & '"
'this line gets the error
Set rs2 = db2.OpenRecordset(vSql, dbOpenDynaset, dbSeeChanges)
EmpID is defined as a text field in the table PiecePay. Since EmpIDHold is defined as a string, I don't know how that could cause the mismatch. Do I have any of my quotes wrong in the select statement? Is there anything wrong with the Set statement? I want to edit the record if it is found. If it is not found, I will add it.
EmpIDHold has the value "1987" when the error occurs.
Thanks for any help.