Hi all,
I am using VBA in Office XP for the first time.
Firstly, I could not Dim a variable as Database, so I added the DAO 3.6 as a reference. This may be my mistake, I'm not sure.
I then tried to set a RecordSet variable with db.OpenRecordset, and this gave me a mismatch error. What am I doing wrong? This was never a problem when using Access 97.
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from Statements")
I guess the reference to DAO3.6 may be causing the problem, but I don't know what the correct reference should be. I already have VBA and Access10 references selected, but these do not make the Database Object available.
Thanks in advance.
I am using VBA in Office XP for the first time.
Firstly, I could not Dim a variable as Database, so I added the DAO 3.6 as a reference. This may be my mistake, I'm not sure.
I then tried to set a RecordSet variable with db.OpenRecordset, and this gave me a mismatch error. What am I doing wrong? This was never a problem when using Access 97.
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from Statements")
I guess the reference to DAO3.6 may be causing the problem, but I don't know what the correct reference should be. I already have VBA and Access10 references selected, but these do not make the Database Object available.
Thanks in advance.