T
Tim Johnson
Hi there,
I consider myself fairly experienced with MS Access (I'm no MVP, but I can
definitely find my way around most scenarios); but this one leaves my jaw
dropped and my brain befuddled.
Any idea why Access 2003 would throw a 3420 error (object invalid or no
longer set) with the following code:
Sub Test()
Dim tdf As TableDef
Set tdf = CurrentDb.TableDefs("Table1")
Debug.Print tdf.Name
End Sub
?
Seems pretty simple to me: 1.) Declare variable, 2.) Set object variable,
3.) Print object name, but it throws an error.
I have thus far taken the following courses to identify the source of the
problem, in this order:
Operating under the assumption that this could be because of a corrupt
database, or an invalid declaration in another module, I quickly put this
code into a brand new mdb file (as well as the table) and it STILL throws the
error.
Tried using Option Explicit instead of Option Compare Database
I've checked the VBA references and can verify the following *seem* to be
intact:
Visual Basic for Apps, Microsoft Access 11.0 Object Library, OLE Automation,
Microsoft DAO 3.6 Object Library, and Microsoft ActiveX Data Objects 2.5
Library
In the Add or Remove Programs section of the Control Panel, I have opted to
"Repair Office", as well as using the "Change" button to remove and then add
the Access feature.
I haven't been able to find useful information on google regarding this
specific scenario; so any help is GREATLY appreciated.
Thanks in Advance,
Tim
I consider myself fairly experienced with MS Access (I'm no MVP, but I can
definitely find my way around most scenarios); but this one leaves my jaw
dropped and my brain befuddled.
Any idea why Access 2003 would throw a 3420 error (object invalid or no
longer set) with the following code:
Sub Test()
Dim tdf As TableDef
Set tdf = CurrentDb.TableDefs("Table1")
Debug.Print tdf.Name
End Sub
?
Seems pretty simple to me: 1.) Declare variable, 2.) Set object variable,
3.) Print object name, but it throws an error.
I have thus far taken the following courses to identify the source of the
problem, in this order:
Operating under the assumption that this could be because of a corrupt
database, or an invalid declaration in another module, I quickly put this
code into a brand new mdb file (as well as the table) and it STILL throws the
error.
Tried using Option Explicit instead of Option Compare Database
I've checked the VBA references and can verify the following *seem* to be
intact:
Visual Basic for Apps, Microsoft Access 11.0 Object Library, OLE Automation,
Microsoft DAO 3.6 Object Library, and Microsoft ActiveX Data Objects 2.5
Library
In the Add or Remove Programs section of the Control Panel, I have opted to
"Repair Office", as well as using the "Change" button to remove and then add
the Access feature.
I haven't been able to find useful information on google regarding this
specific scenario; so any help is GREATLY appreciated.
Thanks in Advance,
Tim