I copied the following code from a control event in a database that works:
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Dim dbs As Database
Dim rst As Recordset
Dim month, year As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblSORM_00_02”, dbOpenDynaset)
However, when I try to run the code in a new database I get Type mismatch error on the last line. I checked the references and they appear the same in both databases. Does anyone have any idea where I should look for the remedy?
Thanks.
Ken