Query broken link error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's up MVPs?! Hope you're all doing well!

If I have a query with a broken link, when I open it from the db window, and
error message displays. Unable to display... blah blah...

But, if I open the query this way:

DoCmd.OpenQuery qdf.Name, acViewDesign

The error message doesn’t fire.

Any idea how to get/catch the error message to trigger from VBA code?

TIA,

Steve Clark
FMS, Inc.
 
Do you mean you use some object, which VBA knows as qdf, but whose ***name
property*** is to be used as argument of the DoCmd.OpenQuery? If so, are
you sure the object qdf.name is the same name as the query you use from the
db window?

Alternatively, is the query using a reference to a form, for one of its
parameter, form which is closed when using the db window and open when you
use the VBA line of DoCmd?


Can be something else too, evidently.


Vanderghast, Access MVP
 
I'm using For...Each to loop through every query name to open it in design
view. (Specifically to find any broken link errors) So, eventually, the name
in the qdf.Name will match.

You are correct that there is a parameter referencing a form in the query.
But, that form is NOT open when either open method is executed.
 
The form is NOT open, and one solution works, displaying some (valid) data?
I suspect some error handling is 'fixing' something it should not.


Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top