"mary_jane_steele@hotmail dot com"
The Database object is a DAO object, and Access 2000 and 2002 don't
include a reference the DAO Object Library by default. You must add a
reference to it, if you want to use DAO objects. To do that, open the
VB Editor and click Tools -> References... on its menu bar. In the
References dialog, locate Microsoft DAO 3.6 Object Library in the list,
and put a check mark in the box next to it.
The DAO library and the ADO (ActiveX Data Objects) library that is set
as a default reference in Access 2000+ contain several f the same
objects. Therefore, it's best if you either remove the ADO reference if
you don't plan to use it, or else always identify each object you
declare from these libraries as to which library, DAO or ADODB, that it
comes from. For example,
Dim db As DAO.Database 'not strictly necessary, not in ADO lib
Dim rs1 As DAO.Recordset 'necessary
Dim rs2 As ADODB.Recordset 'a good idea