Access Query error locks design view

B

BakerinTN

I have a query that has a syntax error. The pop-up error window takes focus
and one cannot use the design view window to make the needed correction. If
one closes the error window, the design view window also closes. One cannot
access the SQL view to make the needed changes either, because accessing SQL
requires an active Design View window. So...we have a query that throws an
error but cannot be corrected using the normal methods (Design View).

Is there any back door to the SQL view so that changes can be made in SQL??

Any other ideas how to get this query repaired??
 
J

John W. Vinson

Is there any back door to the SQL view so that changes can be made in SQL??

In VBA you can look at the SQL property of the Querydef object:

Dim db As DAO.Database
Dim qd As DAO.Querydef
Dim strSQL As String
Set db = CurrentDb
Set qd = db.Querydefs("BadQuery")
strSQL = qd.SQL

What I'd do then is delete the query and recreate it by editing the SQL
(outside of Access) and copying it into the SQL window of a new query. Compact
the database in between to be on the safe side!
 

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

Top