Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Access's query editor decide whether to discard my formatting?

Like a lot of developers who are comfortable with SQL syntax I get frustrated when working with Access's query editor. I'm talking about the raw SQL Syntax view, obviously.

One of its many annoying properties is that upon saving it will discard my layout / formatting. When reopening the query all I see is a bunch of unformatted SQL.

However, if my syntax is long and/or complex enough I've noticed that Access will retain my formatting and layout and, oh joy, the query remains clear and readable. I'm looking at an example right now with a page of SQL containing couple of UNIONs all nicely laid out from a few days ago.

At what point does Access flip over to allowing the user to retain his own formatting? Is it length? Complexity? And is there maybe even a trivial structural edit (if trivial structural isn't an oxymoron) I can make to all my queries which will force Access to leave my layout in place?

like image 448
hawbsl Avatar asked Nov 08 '11 11:11

hawbsl


People also ask

What is the first thing a user must do when creating a query in query Design view?

Step 1: Add data sources On the Create tab, in the Other group, click Query Design. Double-click each data source that you want to use or select each data source and then click Add.

What sheet will allow you to change the formatting of a field in a query?

Click the Property Sheet button on the Design tab. The Property Sheet appears. Here, you can adjust how your fields are formatted.


1 Answers

There are certain things that Access' query editor is not able to display in design mode.
Queries with UNION are the only thing that come to my mind right now, but there are probably more.

In my experience, Access always changes the layout as long as it's able to display the query in design mode.
As soon as you put something in the query that Access can not display in design mode (like UNION), Access leaves your layout and formatting as it is.

like image 124
Christian Specht Avatar answered Sep 19 '22 19:09

Christian Specht