Importing Form problems

D

Dave

I am attempting to import forms (and code) from a sample
database call LogUsersOff2K.mdb from
http://www.rogersaccesslibrary.com/

I am trying to import the forms (and code) to an existing
database, however I am getting this error on the event ON
LOAD for the form frmLogOff.

"User-defined type not defined"
The error highlights on the first DIM statement
on "DAO.Database"

What else do I need to import or establish in my existing
database to not receive this error message?

'*** Actual Code in the ON LOAD event *****
Private Sub Form_Load()
Dim db As DAO.Database
Dim snp As DAO.Recordset
Dim msg As String

Set db = CurrentDb
Set snp = db.OpenRecordset("Settings", dbOpenSnapshot)
If snp![logoff] Then
msg = "The database is closed for updating" & vbCrLf &
vbCrLf & "Please try later."
MsgBox msg
Application.Quit
End If
DoCmd.Hourglass False

End Sub

' *****End of Actual code *****************************
 
J

Joan Wild

Hi Dave,
"User-defined type not defined"
The error highlights on the first DIM statement
on "DAO.Database"

What else do I need to import or establish in my existing
database to not receive this error message?

With the module open, go to Tools, References, and set a reference to
MS DAO 3.6 Object Library.

Then be sure to Debug, Compile and then save.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top