5

I'm trying to use a macro/.mdb file that was written in Access 2003 in a new Access 2010 Access install. Opening my file I get a compile error saying the TableDef object is not able to be found. When I check my Tools->References menu I see Microsoft DAO 3.6 Object Library as available, shouldn't that suffice? Or is something else needed for the TableDef?

braX
  • 11,506
  • 5
  • 20
  • 33
WildBill
  • 9,143
  • 15
  • 63
  • 87
  • 2
    The DAO library for Access 2007 and 2010 is `Microsoft Office x.x Access Database Engine Object Library`, not `Microsoft DAO 3.6 Object Library` – Fionnuala Dec 17 '12 at 16:40
  • I enabled that library but I am still getting the same compile error... – WildBill Dec 17 '12 at 16:44
  • 1
    You must prefix TableDef with "DAO", ex. Dim td as DAO.TableDef. – ron tornambe Dec 17 '12 at 16:45
  • Please post some code and mark the line causing the error. Do you have Option Explicit at the top of the module? – Fionnuala Dec 17 '12 at 16:45
  • 1
    @rontornambe Since when? – Fionnuala Dec 17 '12 at 16:47
  • 1
    I moved the Microsoft Office x.x Access Database Enginer Object Library up in priority and it no longer halts on that object. So thanks! It's not crashing on another object/method. Is there a good srouce that shows the libraries needed for each object in Microsoft Access? – WildBill Dec 17 '12 at 16:53
  • Remou, you should have made that an answer. It solved my problem. It may have uncovered others nut it solved my initial problem :) – WildBill Dec 17 '12 at 16:53
  • Please close out http://stackoverflow.com/questions/13809015/new-admin-for-ms-access-how-to-modify-existing-macro/13809768#comment19184806_13809768 if this is the answer to that issue as well. Danke. – KFleschner Dec 17 '12 at 17:15
  • This is not the answer to that question but after learning more about this environment I realize a correct answer was back on that page. This question was just one part of that question and a very specific question. – WildBill Dec 17 '12 at 17:34
  • No Remou you do not always have to prefix TableDef with DAO, but it is another way of resolving this type of conflict. – ron tornambe Dec 17 '12 at 18:22

1 Answers1

7

The DAO library for Access 2007 and 2010 is Microsoft Office x.x Access Database Engine Object Library, not Microsoft DAO 3.6 Object Library.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152