What's wrong with this code?
And how can I fix it?
Code:
Dim myDB As Database, myTable As TableDef, myRecordset As Recordset
Set myDB = OpenDatabase("C:\Data\" & InGeo & "ImpData.mdb")
Set myTable = myDB.TableDefs("MAIN")
Set myRecordset = myTable.OpenRecordset
myRecordset.Filter = "BATCHNO = '" & BatchNo & "' AND YEAR = '" & FYear & "'"
Set myRecordset = myRecordset.OpenRecordset
With myRecordset
.MoveFirst
etc. etc. I get a message "Operation is not supported for this type of object", in the line myRecordset.Filter = "BATCHNO