I am close to the end of a module and this error number 94 starts appearing. It always highlights recordset closing. Here is sample code:
I am hitting this error message when I reach rr.Close. I commented this line out. This time it started complaining at rt.Close. Help is highly appreciated. Thanks.
Code:
Public Sub ImportSheet()
On Error GoTo Error_Handler
Dim rr As Recordset, RT As Recordset, ch As Recordset
Dim db As Database
Set db = CurrentDb
Set rr = db.OpenRecordset("OriginalTbl")
Set RT = db.OpenRecordset("TargetTbl")
Set ch = db.OpenRecordset("SearchingTbl")
ch.MoveFirst
......
Some code
.......
ch.close
set ch = Nothing
rr.MoveFirst
Do While Not rr.EOF
rt.AddNew
.............
Some code
..............
rt.Update
rr.MoveNext
Loop
rr.Close
rt.Close
Set rr = Nothing
Set RT = Nothing