view SQL statement

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

Guest

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
 
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?
 
Yep.....I've learned many things the "hard" way!

--
Ken Snell
<MS ACCESS MVP>

Josh W said:
Thanks, Ken. Seems so simple, but if you don't know it, it really can cost
time.
 
Ken Snell said:
Yep.....I've learned many things the "hard" way!

Don't you wish that just once, after you find out how to do something, you
could say "Wow, that was really complicated?" instead of "Oh, of course."
 
Actually, I have done/said that a few times....usually right after I've just
looked at the code for a complicated process after not reviewing it for a
few months!
 
Back
Top