• Sort Order on Form after Requery

    Author
    Topic
    #463637

    Oooooo Pretty.

    Hi Guys

    Got a bit of a problem I’m wrestling with.

    I’ve got a Form (Displaying in Datasheet View), Cant seem to get the (“Order By” = [Entered Date]) to work on load, but also I can’t seem to get it to work when I docmd.requery, after an automated update process, to present the correct order by [Entered Date]. I do have a Unique ID (no duplicates) field it seems to default the order ascending to, after updates and load. I have tried changing the underlying Table default sort and saving it also.

    Is there any other property within Access Forms I need to be aware of (like can we use Filter ? Is that SQL).

    I *have* played with the Orderonload etc from VBA etc.

    More details on request if this is unclear.

    Ta graliv1

    Viewing 1 reply thread
    Author
    Replies
    • #1184288

      You should set the sort order in the Record Source of the form.

      • #1184316

        You should set the sort order in the Record Source of the form.

        Tx Hans. I’ve tried that in all Combinations:

        RELEVENT TO A DATE FIELD CALLED [Entered]

        1) Putting Entered Desc in the Orderby Property of the Form
        2) using Me.orderby = “Entered Desc” in the VBA code whilst running a function called by the timer
        3) The record source will only accept a valid table name
        4) using Me.Filter = Valid SQL in the VBA code whilst running a function called by the timer.

        1) The order that displays is relevant to the first field that is a unique ID (Alphanumeric) The enetered Firled is the last field in both table and form
        2) There is a subdatasheet attached to the table on the ID field, but I’ve tried unattaching it to see if that affects it. It dosn’t.
        3) There is a Sub-Form attached to the form but this essential to the function of the Form.
        4) The display format is datasheet.

        Can’t really think what else to do?

        I’m going to keep thrashing away at it, and will advise you if I succeed.

        • #1184322

          The record source of a form can be

            [*]The name of an existing table[*]The name of an existing query[*]An SQL string that begins with SELECT
          • #1184327

            The record source of a form can be

              [*]The name of an existing table[*]The name of an existing query[*]An SQL string that begins with SELECT

            Ahhhh. Well there it is that piece of Knowledge I needed.

            Thank-You I’d be scratching my head till doomsday without that input.

    • #1184328

      Just one little piece of info you need to remember. If you are setting the OrderBy property of the form via code, you need to make sure you turn-on the OrderByOn property, like this: Me.OrderByOn = True

    Viewing 1 reply thread
    Reply To: Sort Order on Form after Requery

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: