Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Setup / Configuration / April 2004

Tip: Looking for answers? Try searching our database.

Importing Form problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 26 Apr 2004 17:30 GMT
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 *****************************
Joan Wild - 26 Apr 2004 23:20 GMT
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.
Signature

Joan Wild
Microsoft Access MVP

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.