sorted querry, but unsorted form

G

Guest

I made a querry, and sorted the querry (basically alphabeitcally), but then
when I used the querry for a form the records are coming up by primary key,
instead of sorted form. How can I change the order?
 
V

Van T. Dinh

Use the "Sort" row in the Query Design Grid. In the Column that you want to
sort, select either Sort Ascending or Sort Descending. This translates to
the ORDER BY Clause in your SQL String.

Alternatively, you can use the "Order By" and "Order By On" Property of the
Form. However, I think this is less efficient than the ORDER BY Clause in
the Query / SQL.
 
G

Guest

I had already sorted the querry, and it was not sorting the form. When I
went to the form properties and looked at record source, I was then able to
sort for the form. I did not see any way to directly look at the SQL. Is
there a way?
 
G

Guest

Hey jlwood, you can accomplish this through the form's properties. In design
view, open the form's properties and goto the Data tab. In the Order By
field, enter the field you would like to order by. The format is:
TableName.FieldName.

Also, as Van noted, it is probably better to do this directly through the
query. Access sorts the fields in a query from left to right, so if your
primary key is the first field from the left, and you are sorting on multiple
fields, the primary key will be the first sort. If you would like to sort on
another field, move this field to be the first field from the left.
 
V

Van T. Dinh

Post the SQL String of your Query.

To get the SQL String, open the Query in DesignView and then use the "View"
Toolbar ComboBox (left-most Control of the "Query Design" Toolbar) to select
the SQL View. Alternatively, you can use the Menu View / SQL View to switch
to the SQL View.

If you already have the Order By Clause correctly, check the Form's
Properties "Order By" (should be empty) and order "Order By On" (should be
No/False).
 

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

Similar Threads

Data Source 4
Eliminate Duplicated 2
Help Me Fix Min Max Avg Querry 1
Too many forms? 3
Querry Criteria 3
Some querries not showing in Word Mailmerge 4
Check a form for no records 1
Report order 7

Top