Results 1 to 5 of 5
  1. #1
    Euler271 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    63

    DAO problem

    This is something I haven't run into before.



    I started writing a Sub:

    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Set db = CurrentDb
    Set rst = db.OpenRecordset("tblReports")
    rst.MoveLast
    rst.MoveFirst
    rst.Close

    I then tried to compile it but I got the message at the rst.MoveLast line: "Compile error: Method or data member not found"

    I then checked the references and didn't find "Microsoft DAO 3.6 Object Library" in there so I tried to add it. I then got the message:
    "Name conflicts with existing module, project, or object library"

    I opened the object browser and found the DAO library was in there.

    What gives? The DAO library is in the object browser but not in the references list and I get an error telling me that the DAO library isn't loaded because it can't find the MoveLast method.

    Has anybody run into this? Thanks for the help.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    It's been replaced by the Microsoft Office Access xx.0 Database Engine Object Library which contains additional functionality.
    You can have one or other but not both
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Euler271 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    63
    I have that in my references: Microsoft Office 14.0 database engine Object Library.

  4. #4
    Euler271 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2017
    Posts
    63
    Thank you all for your attention and response but I found the problem and it was my own fault.

    I had written dim rst as DAO.Database and not rst as DAO.Recordset. I shouldn't listen to the radio and work at the same time, I guess.

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Euler271 View Post
    <snip> I had written dim rst as DAO.Database and not rst as DAO.Recordset.<snip>
    Welcome to the club!!
    I've done the same thing a few times when I've been in too much of a hurry or late at night.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 07-06-2015, 01:47 AM
  2. Replies: 2
    Last Post: 10-31-2012, 11:52 AM
  3. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  4. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums