recordset type mismatch

  • Thread starter Thread starter Souris
  • Start date Start date
S

Souris

qdfCurr.Parameters("EmployeeID").Value = cmbEmployee.Value
qdfCurr.Parameters("Activity_Date").Value =
CDate(Int(dtpActivityDate.Value))
Set rs = qdfCurr.OpenRecordset()

I tried to assign above 2 values to my qdfCurr.parameters

I got type mis match when I OpenRecordSet().

The Ativity_Date is datetime type field which contains date only. I check
debug that CDate(Int(dtpActivityDate.Value)) returns date type too.

I am not sure how it comes mis type error.

Your help is great appreciated,
 
You don't show the declaration of rs, but if you have:
Dim rs As Recordset
change it to:
Dim rs As DAO.Recordset

The prefis for qdfCurr suggests it is a QueryDef object, which is from the
DAO library. ADO also has a Recordset object, which would yield a Type
Mismatch. Being explicit about which one you want would solve that problem.

For more info about which library references you need for your version of
Access, see:
http://allenbrowne.com/ser-38.html
 
Thanks for the message,

Allen Browne said:
You don't show the declaration of rs, but if you have:
Dim rs As Recordset
change it to:
Dim rs As DAO.Recordset

The prefis for qdfCurr suggests it is a QueryDef object, which is from the
DAO library. ADO also has a Recordset object, which would yield a Type
Mismatch. Being explicit about which one you want would solve that problem.

For more info about which library references you need for your version of
Access, see:
http://allenbrowne.com/ser-38.html
 
Back
Top