Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open query in sql view

Status
Not open for further replies.

DrewConn

Programmer
Jan 8, 2002
167
US
Is there any way to open a query in SQL view? I dont mean open in design and then switch, I need to actually have the query open in SQL view.

Thanks.
 
If you're asking what I think you're asking (SQL Server Query Analyzer or Enterprise Manager SQL views, etc.), you'll have to design your own utility form to do this. Access has no SQL View display format like those other products.
 
I'm not sure if this is what you're looking for, but in VBA you can open the query in design mode, then use sendkeys to switch to sql view mode. There may be a better way (I don't particularly like send keys) but I'm not aware of it. The code looks like:


function OpenQuerySQL()
DoCmd.OpenQuery "query1", acViewDesign
SendKeys "%vq"
end function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top