Re: Problem with QueryDefs in VBA
- From: Jack Leach <dymondjack at hot mail dot com>
- Date: Wed, 23 Sep 2009 08:15:01 -0700
or advice from someone who
I'll recognise as being suitably knowledgeable, such as one of the MVPs -
that it will solve the problem.
Well maybe next time you can post your question as
MVP's ONLY!!!
[question]
It's not all that hard to make a copy of the db to try it... and just
because you don't see why certain things might work, doesn't mean others
don't also... mvp's or not.
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
"Rob Parker" wrote:
Hi Jack,.
Thanks for the response, but (to me) it seems that you've as little idea of
what's happening as I have.
I never have "Name AutoCorrupt" turned on in any of my databases, and I
can't conceive of how this might be of any influence to this problem. And
(as I understand it - please correct me if I'm wrong) Decompile only affects
the VBA code, not the database itself. And, as I said in my original post,
compact/repair failed to fix the problem.
Perhaps importing all my database objects into a new database would work,
but I'm loathe to try that I have some evidence - or advice from someone who
I'll recognise as being suitably knowledgeable, such as one of the MVPs -
that it will solve the problem. There is nothing else happening with this
database that leads me to think it is corrupted.
Rob
Jack Leach wrote:
You can try:
Turning off Track Name Autocorrect
Importing everything into a new db or using the Decompile switch
I would think that a compact and repair would fix the issue, but if
you have Name Autocorrect on maybe not.
good luck!
I'm attempting to get a list of all queries in my database which have
parameters, via the following:
Dim qry As DAO.QueryDef
For Each qry In CurrentDb.QueryDefs
If qry.Parameters.Count > 0 Then
Debug.Print qry.Name
End If
Next qry
This fails, with RTE 3078 (MS Jet database engine cannot find query
'qryOrders_Arisings')
If I omit the inner If statement, and run the following, I get (as
expected) a list of all the queries:
For Each qry In CurrentDb.QueryDefs
Debug.Print qry.Name
Next qry
This list does not include qryOrders_Arisings (which was previously
in the database, but was deleted ages ago).
If I change the code to:
For Each qry In CurrentDb.QueryDefs
Debug.Print qry.Name; qry.Parameters.Count
Next qry
I again get RTE 3078.
I've done a compact/repair; I've included
CurrentDb.QueryDefs.Refresh
at the top of my code; I've tried
CurrentDb.QueryDefs.Delete("qryOrders_Arisings")
which gives RTE 3265 (Item not found in this collection) - not
unsurprisingly.
What's going on here, and how can I fix it?
TIA,
Rob
- Follow-Ups:
- Re: Problem with QueryDefs in VBA
- From: Rob Parker
- Re: Problem with QueryDefs in VBA
- References:
- Problem with QueryDefs in VBA
- From: Rob Parker
- RE: Problem with QueryDefs in VBA
- From: Jack Leach
- Re: Problem with QueryDefs in VBA
- From: Rob Parker
- Problem with QueryDefs in VBA
- Prev by Date: Re: Problem with QueryDefs in VBA
- Next by Date: Re: close table restore form
- Previous by thread: Re: Problem with QueryDefs in VBA
- Next by thread: Re: Problem with QueryDefs in VBA
- Index(es):
Relevant Pages
|