I just read that you are using Access 2000. Make sure that you have the DAO library installed. Open the code window. Click on Tools, References, and scroll down to the Microsoft DAO object library. Click it. Then the code should run. If it doesn't Dim the db and rs like this:
Dim db As DAO.Database
Dim rs As DAO.Recordset
It should work either way. dz
dzaccess@yahoo.com