Directly into SQL view

geister

New member
Local time
Today, 12:55
Joined
Jan 16, 2017
Messages
9
Is there any way to open up SQL view directly?
 
SQL view in Access.

And to load it up directly without using the Query Wizard or Query Design.
 
Not that I'm aware of. You can create a generic query in SQL and save that. Then when you want to create a new query, open the generic in design view and overwrite the existing sql statement and do a save as (or copy the existing query to a new name and then open it in design view).

To set up the generic query for the first time:
Create new query, go to design view click on SQL
Paste in exactly as shown:
Code:
SELECT * FROM X;
Save it as qrySQL (or whatever you want to call it to remind you that it is a generic sql query.
 
Not that I'm aware of. You can create a generic query in SQL and save that. Then when you want to create a new query, open the generic in design view and overwrite the existing sql statement and do a save as (or copy the existing query to a new name and then open it in design view).

To set up the generic query for the first time:
Create new query, go to design view click on SQL
Paste in exactly as shown:
Code:
SELECT * FROM X;
Save it as qrySQL (or whatever you want to call it to remind you that it is a generic sql query.

Thank you, this makes sense. It is a shame there is no direct button, but this is close enough.
 
Not sure why geister's posts keep getting moderated, but I've approved them. Reformed spammer maybe? :p
 
Not sure myself, I do use a VPN so sometimes sites don't like that.

Due to a bug in the forum software this message was "unapproved" (hidden) for some considerable time. I have just approved it. I hope no one has been inconvenience too much! The new forum software no longer has this bug, so this problem should not reoccur.
 
When I save and close a query while in SQL view, the next time I open it in Design, it opens instead in SQL. Try it.
 
Access often trashes the SQL layout so it is pretty horrible for complex queries.
One way to make Access leave it alone is to add this at the end of the query.
UNION ALL SELECT Null, Null ..... FROM DummyTable.

Include as many Nulls as there are fields in the main query.
DummyTable is just any table with no records.

The query will always open in SQL View and Access won't trash the layout.

The UNION may make the query run slow or be not updateable so I sometimes keep the SQL with the UNION just for editing and paste the rest of it into another query just for running it where I don't care what Access does with the layout.
 

Users who are viewing this thread

Back
Top Bottom