Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error: User-Defined type not defined - DAO Ref Error??

Status
Not open for further replies.

victorialj

Technical User
Sep 24, 2004
7
GB
Hi,

I have been trying now for several hours to open and update a recordset. I seem to be having trouble compiling the project and running it (or even F8'ing it!)

Basically all posts I have read, both hear and on the ms forums say I need to have the Microsoft DAO 3.6 ref selected in tools/references. However I do not even have a ref called this listed in mine at all? I am using 2002 on XP.

Is this actually the problem or is it something else?

I have inserted some of the code below (i have written and re-written several times today, so this is the latest I have tried!).

any help would be gratefully received:
Code:
Dim db As Database
Dim rst As Recordset
Dim strTimeStamp As String
Dim strUsername As String

Set db = CurrentDb
Set rst = db.OpenRecordset("Prop Batch ID")
strTimeStamp = Now
strUsername = Environ("username")
With rst
        .AddNew
        !TimeStamp = strTimeStamp
        !username = strUsername
        .Update
End With

Thanks
Victoria
 
Dim rst As DAO.Recordset

menu Tools -> References ...
Tick Microsoft DAO 3.x Object Library

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,

Thanks for the above - have just found out that my pc had no reference to the Microsoft DAO 3.6 (couldn't tick it - as per above). Have just located it via the browse option and copying from someone elses machine, and is now working.

Thanks
Victoria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top