Access Query error locks design view

  • Thread starter Thread starter BakerinTN
  • Start date Start date
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??
 
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!
 
Back
Top