"amy14775" <(E-Mail Removed)> wrote in message
news:F15FF122-7FD7-4DB4-8B4E-(E-Mail Removed)
> Please help. I am attatching a module with code in it to a calculation
> command button in my access program. But I keep getting a compile
> error at this line:
> Dim db as Database
>
> I don't even have Database as a type of variable available. I am
> confused because everything I have read and seen shows it like this
> with the next line as
> Set db = CurrentDb.
> I don't know why it will not let me choose Dim db as Database.
> Any help would be great.
> Thank You
You must be using Access 2000 or 2002. You need to add a reference to
the Microsoft DAO 3.6 Object Library. You can do this from the VB
Editor's Tools -> References... dialog.
Be aware that the DAO library and the (default) ActiveX Data Objects
Library both define some objects with the same names, which are not
compatible. To avoid possible confusion on the part of the VBA
compiler, either remove the reference to the ActiveX Data Objects
Library (if you won't be using it) or explicitly qualify all DAO objects
with the "DAO." qualifier, like this:
Dim db As DAO.Database
Dim rs As DAO.Recordset
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)