Runtime Err 13 - Type Mismatch

T

Tammy

I am trying to run the following code from a form when I
click on a button. It return a Runtime Err 13 - Type
Mismatch error when it gets to the following line:

Set rst_belts = dbs.OpenRecordset("tbl_Belts")

Here is all of the code:

Private Sub Command40_Click()

Dim dbs As Database
Dim rst_belts As Recordset

Set dbs = CurrentDb
Set rst_belts = dbs.OpenRecordset("tbl_Belts")


rst_belts.AddNew
rst_belts!Series = Me!Series

rst_belts.Update


End Sub
 
A

Alex Dybenko

Looks like you have reference both to ADO and DAO, so you have to explicite
declare dao recordset:
Dim rst_belts 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