Confused about DAO and ADO?

Getting User Defined Variable errors?

Most likely, it is a problem with your Object Model.

Since most of my A2000 samples were upgraded from Access97, they still use the DAO model. A database created directly in A2000 will use the ADO model by default.  You can still use my samples, though, if you set a Reference to DAO.  You do that in any code window.   Go to Tools > References and scroll down the list until you find "Microsoft DAO 3.6 Object Model" (the actual wording may vary, but that is the idea).

The only other thing you have to worry about (I tried to do this in all of my samples, but may have missed some) is to preface all of your object variables with "DAO."

For example:
Dim db as DAO.Database
     Dim rs as DAO.Recordset
and so forth.

The following link has a more indepth explanation:

If you've not run across it before, Allen Browne's site is another wonderful resource.

-- Roger Carlson