column order confusion

P

patti

I have a query that shows the results in a different column order than what
is shown in the design view. When I copy and paste the SQL into a new blank
query, the column order matches the design. What is happening with this
query & its resulting column order? Have the properties of the query been
someone how changed - and if so where can i go to rearrange this?

thanks.

patti
 
L

Lord Kelvan

i know if you uncheck the check box to exclude that column from the
query it will appear at the end of the query in design view if you
want it to appear in a certain order and it appears not to run the
query and drag the columns into the order you want and save the query
and it should keep it that way

Regards
Kelvan
 
P

patti

thanks for the reply.

in design view, the columns are in the order i want and i want them all to
show, but when i go to view the results, the columns get moved around.
 
L

Lord Kelvan

yea and when you are in that point where you see the results you can
click and drag the column headers into new positions then save your
query and it shoudl keep them that way from now on
 
J

John W. Vinson

thanks for the reply.

in design view, the columns are in the order i want and i want them all to
show, but when i go to view the results, the columns get moved around.

What does it matter?

You should never be looking at the query datasheet anyhow. If you base a Form
or Report on the query, you can put the controls bound to the query fields
wherever you like.
 
P

patti

Gotcha Lord. Thanks for the help. I was just confused.

John-
re the column order, it was disconcerting to see the info not in the
expected columns. I was working off an existing query and trying to validate
data quickly.
I moved onto solving my issue, knowing that how the data appeared didn't
matter inb a query.
So access stored the view within the properties of the query somewhere?

Thanks agian for all the help.
 
J

John Spencer

Yes, Access stores the column order of datasheet view when you rearrange them.
It also stores information on which columns you hide, the width of the
columns if you resize them, any filters or sorts you have set up in the
datasheet view, and other information (fonts, colors, etc) of the datasheet
view. The thing to remember is that the datasheet view is just a way to see
the information returned by a query and has nothing to do with the actual
query beyond using the query as a record source.

As you have noted, if it matters to you the easiest way to realign the columns
of the datasheet view with the columns in the query is to copy and paste the
SQL statement into a new query and then save the new query over the old query.

Until you rearrange the columns in datasheet view (and save the changes),
Access will match the query order when displaying the data even when you
rearrange the column order in the query.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
P

patti

As always, thanks for the explanation. Tis very kind of you to share your
expertise and insights.

patti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top