Although my scenario is different, it's similar enough for me to think that
this might be it... comments welcome!!
(below taken from Microsoft Knowledge Base Article - 200592)
The following example attempts to use the CurrentDb function to return a
pointer to the database that is currently open in Microsoft Access. Because
the code does not assign that database to an object variable, the pointer
returned by the CurrentDb function is temporary and becomes invalid after
the TableDef object is set. Consequently, any later references in your code
to the TableDef object variable will result in an error.
1.. Start Access and open the sample database Northwind.mdb.
2.. Create a module and type the following procedure:
Sub CurrentDbFail()
Dim td As DAO.TableDef
Set td = CurrentDb.TableDefs("Customers")
MsgBox td.Name
End Sub 3.. To test this procedure, type the following line in the
Immediate window, and then press ENTER:
CurrentDbFail Note you receive the error described in the Symptoms
section of this article
"deko" <dj****@hotmail.com> wrote in message
news:zC***********@newssvr27.news.prodigy.com...
I'm getting intermittent "Object Invalid or No Longer Set" errors in my
Access 2002 mdb.
What causes these errors?
Has anyone dealt with this before?
I can't trace it because it's not easy to duplicate -- it just show up...
I've heard that spurious queries that use Now() or Date() or some other
date function can cause this error. ???
Any suggestions welcome!!
Thanks!