Following up on the References mentioned by Van, you will probably run into the DAO/ADO
problem. Access 97 uses DAO, by default 2000 & 2002 use ADO. You may have to set the
reference for DAO. To do so, open the code window (Alt+F11) and go to Tools|References.
See if there is a check next to Microsoft DAO 3.xx Object Library. If not, scroll down and
check the box next to the highest version of DAO listed (probably v3.60). Click Ok then go
back into the References dialog. You should notice that the item you just checked is up
near the top, at the bottom of the rest of the checked items. Access uses these in the
order they are listed, hence the up and down buttons to the right side of the list.
At this point you have a few choices. 1) Uncheck ADO (I don't recommend this one), 2)
Highlight DAO and use the Up button to place it above ADO (works as a quick fix), 3)
Change your DIM statements to explicitly differentiate between ADO and DAO (recommended).
Where the problem comes in is that ADO and DAO both have objects that have the same name;
for example, both have Recordset objects. If you DIM something as a Recordset and ADO is
listed above DAO then Access will try to use the ADO recordset instead of the DAO
recordset (once again, they are used in the order listed in the References window).
To explicitly DIM for DAO change your "As Recordset" commands to "As DAO.Recordset". You
may also need to do this for "As Database", "As QueryDef", "As Field", etc. You should be
able to use the Replace (Ctrl+H) function on the Edit menu in the code window to do this
throughout the database automatically.