Sorting in Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WimKoene
    New Member
    • Nov 2006
    • 2

    #1

    Sorting in Forms

    Hi,

    I am new to this forum and also a learner for access and have a
    question for the access experts.
    I've build a small access database containing personnel details.
    I have created several tables, queries and forms (including subforms).
    The data in the subforms are displayed in an ascending way (starting with 2001 upto 2006). I want to see the last record first. I've sorted the tables (which display in descending way) the queries (also decending). However, in the subform it remains ascending. I've sorted the form descending and saved the database, but on close and open is again is ascending. How do I fix this?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    What is set as the :
    Record Source?
    Filter?
    Order By?
    Allow Filters?

    Give values for main and sub-forms if possible.

    Comment

    • WimKoene
      New Member
      • Nov 2006
      • 2

      #3
      Dear NeoPa,

      Thanks for responding. Fortunately someone just dropped in today who showed me that, when clicking in the form in design mode, and selecting the properties for the complete (sub) form, you can modify and define a query as record source with the following:
      SELECT * FROM [Illness Details] ORDER BY [Illness Details].Illness_Mutati on_Year DESC , [Illness Details].Illness_Mutati on_Month DESC , [Illness Details].Illness_Mutati on_Day DESC;
      I thought that the sort function would be activated from the query on which the form was based (which was not the case)
      So the problem is cured and I have learned something again.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Now I can see what you want, you're better off setting the :-
        Code:
        Record Source property to
        	[Illness Details]
        Order By property to
        	[Illness Details].Illness_Mutation_Year DESC,
        	[Illness Details].Illness_Mutation_Month DESC,
        	[Illness Details].Illness_Mutation_Day DESC
        This will make it better organised and easier to understand and maintain.
        Your 'someone's code would work fine though.

        Comment

        Working...