Runtime Err 13 - Type Mismatch

  • Thread starter Thread starter Tammy
  • Start date Start date
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
 
Looks like you have reference both to ADO and DAO, so you have to explicite
declare dao recordset:
Dim rst_belts As DAO.Recordset
 
Back
Top