Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch Error 1

Status
Not open for further replies.

durug

Technical User
Mar 22, 2002
335
CA
Hi everybody!

I have this code in the Private Sub cmdAdd_Click() Event:

On Error GoTo Err_cmdAdd_Click
Dim db As Database
Dim rs As Recordset

Set db = CurrentDb()
Set rs = db.OpenRecordset("Author")

and I receive a type mismatch error on the last line.
Does any of you have any idea why?

Thanks,
Durug
 
It appears you are using Access 2000. If this is the case then you should referrence either MS ADO ext 2.1 Object Library or Microsoft DAO Object Library. Your provided example tells me you are referrencing DAO. Therefore your code should look like this:

Dim db as DAO.Database
Dim lrs as DAO.Recordset

Set db = currentDB()
Set rs = db.OpenRecordset("Authors")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top