How can I sort records in a sub-subform?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sroeder
    New Member
    • May 2009
    • 9

    How can I sort records in a sub-subform?

    Hi I need to sort the records in a subform that is part of another subform. How will I go around that. I'm not an expert so please be patient with me.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    It depends upon where you are calling for the sort....

    The basics should still apply:

    Code:
    With Forms!FormName
        .OrderBy = "enter your order Criteria here"
        .OrderByOn = True
    End With
    But syntax will change slightly with nested forms and depending upon where you are calling it from.

    Comment

    • twinnyfo
      Recognized Expert Moderator Specialist
      • Nov 2011
      • 3653

      #3
      It depends upon where you are calling for the sort....

      The basics should still apply:

      Code:
      With Forms!FormName
          .OrderBy = "enter your order Criteria here"
          .OrderByOn = True
      End With
      But syntax will change slightly with nested forms and depending upon where you are calling it from.

      Comment

      • sroeder
        New Member
        • May 2009
        • 9

        #4
        Hello thank you very much for your response. The form is as follows. Suppose you have a restaurant with different dishes for lunch and supper. So you would have a form where you, among other things, would choose between lunch and dinner. In a subform you would have a combo box that shows you the dishes for lunch or dinner depending on what you chose on the form. So this list will actualize the available dishes every time you change for lunch or for dinner. This is not what I need to do but it is similar...
        Thank you very much in advance....

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3653

          #5
          sroeder,

          I'm not sure what your last post has to do with sorting a subform. Are you trying to "sort" (e.g. put things in alphabetical order) or "filter" (e.g. list all the lunch items, based on the combo box selection on the form and then list all dinner items when the combo box is changed)?

          To me, it sounds like the latter....

          Comment

          • sroeder
            New Member
            • May 2009
            • 9

            #6
            I am trying to sort, in my actual case, by date. I'm sorry the example I gave was not explicit enough...

            Comment

            • twinnyfo
              Recognized Expert Moderator Specialist
              • Nov 2011
              • 3653

              #7
              Post #2 should still apply.

              Comment

              • sroeder
                New Member
                • May 2009
                • 9

                #8
                Thank you Twinnyfo I will try it tomorrow

                Comment

                Working...