Hi, Chuck.
how do you go about making the new query
window default to the "SQL View" rather than the "Design View"?
There's no setting to change the default view. You're stuck with it unless
you want to do some leg work. Create a new button on your (Custom or
Database) CommandBar with the following Properties:
Caption: New Query
Screen Tip: New Query
On Action =openNewQry()
Then paste the following code into a new module:
' * * * * Start Code * * * *
Public Function openNewQry()
On Error GoTo ErrHandler
SendKeys "~", False
RunCommand acCmdNewObjectQuery
RunCommand acCmdSQLView
Exit Function
ErrHandler:
MsgBox "Error in openNewQry( )." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Function
' * * * * End Code * * * *
Save the module and name it anything exept openNewQry. Compile the code and
anytime you need to create a new query defaulting to the SQL View pane, just
select this new CommandBar button to open the "Show Tables" dialog window,
select your tables and queries in the list box, then select the "Close"
button. The SQL View pane will pop up with a SELECT keyword followed by the
FROM clause including the tables and queries you selected.
The downside is that this code doesn't exist in every database file, so any
database file that you'd like to use this new feature in will require an
import of this new module and, if you used a custom CommandBar for this
button instead of a built-in CommandBar, the custom CommandBar, too. After
import, the code in the database must be compiled.
But any time you want to open a new query in Design View instead of SQL
View, just use the method that you previously used. At least now you have
choice.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are
[email protected] and
[email protected]
- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.