view SQL statement

J

Josh W

I have some complex SQL statements for several form's underlying queries. If I open the query grid, the SQL statement is altered (spaces and indentations removed). Is there a way to bypass the query grid if I want to look at the SQL statement?
Thanks so much
Josh W
 
K

Ken Snell

What I do is this:

(1) When the query is in the SQL view, save and close it. Then, the query
will open in the SQL view when you open it in "Design" view the next time.

or

(2) From the Immediate window, type this line (use your real name of the
query) and hit enter:

? CurrentDb.QueryDefs("QueryName").SQL

That will print the SQL statement for you so that you can copy it and/or
review it. Then, if you open the query and it changes things, switch to SQL
view and paste the SQL statement on top of what's there.

--
Ken Snell
<MS ACCESS MVP>

Josh W said:
I have some complex SQL statements for several form's underlying queries.
If I open the query grid, the SQL statement is altered (spaces and
indentations removed). Is there a way to bypass the query grid if I want to
look at the SQL statement?
 

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