I want to loop through a set of records, editing where appropriate but keep hitting an error 13 – type mismatch in my code in the line shown below
The sample I am using has single table of names
The code I am using is driven by a button on a simple form as follows
Private Sub test_Click()
Dim db As Database
Dim rst As Recordset
Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset(“tblNames”, dbopentable) – THIS IS THE PROBLEM LINE
Do Until rst.EOF
MsgBox [tblNames].[fldname]
rst.MoveNext
Loop
End Sub
I have set references in Tools/References to the following
Visual basic for applications
MS Access 10.0 object library
OLE automation
MS ActiveX data object 2.1 library
MS DAO 3.6 object library
MS jet and replication object 2.6 library
I’d be grateful for any suggestions as to what I’m doing wrong!