I’m jumping into VBA/DAO code for the first time and I’m having a couple of problems:
— I’m trying to add a RunCode statement to a Macro, but the Expression Builder won’t paste in the procedure that I want. I checked if it would paste in other procedures, and it does.
— I’ve tried manually testing the procedure code (using F8) but I run into an error when I try to open a record set. It seems like it won’t recognize the Database objects. I hover my cursor over the Database object variables and nothing appears. The error is run-time error 13 (type mismatch). I know it sees the database because the Forms code lines are producing the output I want. Below is the code leading up to the error:
****************************
Dim db1 As Database
Dim db2 As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Dim bDate As Date
Dim eDate As Date
Dim rNum As String
Set db1 = CurrentDb
Set db2 = CurrentDb
‘Get beginning date, ending date, release number from Archive form
bDate = Forms![frmArchive]!lstStartDate.Value
eDate = Forms![frmArchive]!lstEndDate.Value
rNum = Forms![frmArchive]!lstRelease.Value
Set rs1 = db1.OpenRecordset(“CorrectionCRs”)
**********************
Thanks,
Bob