Current Database

  • Thread starter Thread starter APH
  • Start date Start date
A

APH

Hi - In Access 97 to open a recordset I would have used:

Dim Dbs As Database
Dim rst As Recordset
Set rst = CurrentDb.openrecordset("tblSWPurchases")

I've just changed to Access 2000 and the code seems to be falling over at
line 1

How do you set a variable for a table within the current database in Access
2000 please?

Thanks

A
 
Sorry the code I have ben trying is:

Dim Dbs As Database
Dim rst As Recordset
Set rst = Dbs.openrecordset("tblSWPurchases")

(tried current.db to see if that worked)

A
 
A,

Open any code module and click Tools|References. It is very likely that you
are missing a reference to: Microsoft DAO 3.6 Object Library. When you
set the reference, you should either move it above the reference to ADO,
delete the ADO reference, or in your code make an explicit reference to the
appropriate library:

Dim Dbs as Database
Dim rst as DAO.Recordset

hth,
 
Thanks Cheryl.

A

Cheryl Fischer said:
A,

Open any code module and click Tools|References. It is very likely that you
are missing a reference to: Microsoft DAO 3.6 Object Library. When you
set the reference, you should either move it above the reference to ADO,
delete the ADO reference, or in your code make an explicit reference to the
appropriate library:

Dim Dbs as Database
Dim rst as DAO.Recordset

hth,
 
Back
Top