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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile error DAO

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Greetings

I have a rather awkard problem:

Ive copied this code perfectly out of the book and everytime I run it this error comes up

User-defined type not defined

And the region highlighted is this:

Dim rst As DAO.Recordset

why is this?

This might not make alot of sense on its own but heres the rest of the code:

Private Sub ShowRecord_Click()
' Find the selected record, then close the dialog box.

Dim rst As DAO.Recordset

' Store the recordset for the Bookings form.
Set rst = Forms!Booking.RecordsetClone

' Locate the record for the selected Customer.
rst.FindFirst "BookingID = " & List6

' Set the form's Bookmark property to move to the record.
Forms!Booking.Bookmark = rst.Bookmark

' Close the dialog box.
DoCmd.Close acForm, "GoToRecordDialog"

End Sub

Its pretty hard to explain the situation fully so heres the link to my briefcase.
It wont take long to download. I promise!


In here is the currently developing system and a readme explaining my situation. Feel free to play around with it

I'm sure you lot will solve this

Thanks
 
This is gonna sound dumb but are you sure you've got the DAO reference checked? If you do, could something have deleted/moved/overwriten it? Check your references to make sure it doesn't say "MISSING:" in front of it. Kyle ::)
 
You need to check your references. Go to your code window (alt-F11) and you'll find references under the tools menu. Scroll down the list and check "Microsoft DAO 3.6 Object Library". You might have a different version number depending on which service pack you have. That should fix your problem.

Good luck!
-Dustin
Rom 8:28
 
You need to set a reference to the DAO libaray. While in your subroutine go up to the tools menu and select references. In the list of references find Microsoft DAO 3.6 Library.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top