TYPE MISMATCH

G

Guest

Hi All,
I thought I got this code right until I tried it and got the error message
"Type Mismatch". I have not figured out what went wrong.

Dim rcdAttend As Recordset, Dtb As DAO.Database
Set Dtb = CurrentDb
Set rcdAttend = CurrentDb.OpenRecordset("PatientAttendance") 'Type
mismatch error
rcdAttend.AddNew
rcdAttend!DDate = DDate1
rcdAttend!DTime = DTime1
rcdAttend!PatientID = PatientID1
rcdAttend.Update

It appears the error occured at the level of Addnew. I had to include
Microsoft DAO 3.6 Object Library in the list of References before the code
was accepted on compile. What should I do?
 
R

ruralguy via AccessMonster.com

Change the Dim statement to:
Dim rcdAttend As DAO.Recordset
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top