Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You should set the sort order in the Record Source of the form.


  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    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.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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

  5. #5
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    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.

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    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
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •