Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Re: sorted querry, but unsorted form

Discussion in 'Information Technology' started by jlwood44@hotmail.com, Oct 27, 2005.

  1. jlwood44@hotmail.com

    jlwood44@hotmail.com
    Expand Collapse
    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?

    "Van T. Dinh" wrote:

    > 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.
    >
    > --
    > HTH
    > Van T. Dinh
    > MVP (Access)
    >
    >
    >
    > "jlwood44@hotmail.com" <jlwood44hotmailcom@discussions.microsoft.com> wrote
    > in message news:1527BA2E-616E-43C5-9C60-9BCA78A701B4@microsoft.com...
    > >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?

    >
    >
    >
     
  2. xRoachx

    xRoachx
    Expand Collapse
    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.

    "jlwood44@hotmail.com" wrote:

    > 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?
    >
    > "Van T. Dinh" wrote:
    >
    > > 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.
    > >
    > > --
    > > HTH
    > > Van T. Dinh
    > > MVP (Access)
    > >
    > >
    > >
    > > "jlwood44@hotmail.com" <jlwood44hotmailcom@discussions.microsoft.com> wrote
    > > in message news:1527BA2E-616E-43C5-9C60-9BCA78A701B4@microsoft.com...
    > > >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?

    > >
    > >
    > >
     
  3. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    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).

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "jlwood44@hotmail.com" <jlwood44hotmailcom@discussions.microsoft.com> wrote
    in message news:345AACD5-B33C-47DE-BFB2-1921844F0113@microsoft.com...
    >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?
    >
     

Share This Page