Why won't this debug in one database but will in another?!?

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have the following code:

Dim dbs As Database
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("newcust")

This will debug and run in one Access 2000 database but
not in another Access 2000 database. I have checked the
references in each database and they are the same.

Any suggestions?

Thanks!
Paul
 
Yes, but are the references in the same ORDER?

Access will choose the first reference in the list as its default, so if DAO
is first in one database and ADO is first in the second database, then the
second database will fail.

Best bet is to "disambiguate" (love that word) your object variables:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
 
Back
Top