Sorting Subreport Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rgsw
    New Member
    • Jul 2006
    • 29

    Sorting Subreport Problem

    Hi – I’ll try to explain best I can: I have two tables – Table 1 has two fields ‘ID’ and ‘Employee name’; it’s linked to Table 2 which has three fields ‘ID’, ‘CodeName’ and ‘Hours’. When data is entered it looks like this:
    ID Name
    1 John Doe
    Table 2
    ID CodeName Hours
    1 Code 20 30.00
    1 Code 30 20.00

    I created a report with Table 2 so it’s sorted by CodeName. I put Table 1 as subreport. I cannot get the subreport to alphabetize Employee Names can this be done?

    Thanks and I hope that made sense!
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Originally posted by rgsw
    Hi – I’ll try to explain best I can: I have two tables – Table 1 has two fields ‘ID’ and ‘Employee name’; it’s linked to Table 2 which has three fields ‘ID’, ‘CodeName’ and ‘Hours’. When data is entered it looks like this:
    ID Name
    1 John Doe
    Table 2
    ID CodeName Hours
    1 Code 20 30.00
    1 Code 30 20.00

    I created a report with Table 2 so it’s sorted by CodeName. I put Table 1 as subreport. I cannot get the subreport to alphabetize Employee Names can this be done?

    Thanks and I hope that made sense!
    What did you try that didn't work?

    Comment

    • RiRo
      New Member
      • Oct 2007
      • 4

      #3
      Originally posted by rgsw
      Hi – I’ll try to explain best I can: I have two tables – Table 1 has two fields ‘ID’ and ‘Employee name’; it’s linked to Table 2 which has three fields ‘ID’, ‘CodeName’ and ‘Hours’. When data is entered it looks like this:
      ID Name
      1 John Doe
      Table 2
      ID CodeName Hours
      1 Code 20 30.00
      1 Code 30 20.00

      I created a report with Table 2 so it’s sorted by CodeName. I put Table 1 as subreport. I cannot get the subreport to alphabetize Employee Names can this be done?

      Thanks and I hope that made sense!
      Did you try using the Sorting/Grouping tool for your subreport?
      RiRo

      Comment

      • rgsw
        New Member
        • Jul 2006
        • 29

        #4
        Originally posted by Rabbit
        What did you try that didn't work?
        I tried in Event on open in the report: Me.Orderby ="Employee Name". Me.OrderByOn=Tr ue. I've tried a ComboBox with employee names and to sort by combo box. I have sorted in subreport but when open through the report it doesn't work.

        Comment

        • rgsw
          New Member
          • Jul 2006
          • 29

          #5
          Originally posted by RiRo
          Did you try using the Sorting/Grouping tool for your subreport?
          RiRo
          Thanks for your reply - yes I did see below response.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            The sorting/grouping tool that Riro mentioned is different than the OrderBy OrderByOn property. The sorting/grouping tool is accessed from View > Sorting and Grouping

            Comment

            • rgsw
              New Member
              • Jul 2006
              • 29

              #7
              Originally posted by Rabbit
              The sorting/grouping tool that Riro mentioned is different than the OrderBy OrderByOn property. The sorting/grouping tool is accessed from View > Sorting and Grouping
              Yes, what I meant in reply to Riro was to see reply to you, which showed that I had also tried that in sorting the subreport. Unfortuantely, that didn't work either. It did sort in subreport correctly, but when I openend the report the subreport did not sort correctly.

              I have been searching and still can't seem to find answer. Is this something that can't be done?

              Thanks for all replies!

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                Let's get some more info.

                How is your main report set up?
                How if your sub report set up?
                What's in each section of each report?

                Comment

                • rgsw
                  New Member
                  • Jul 2006
                  • 29

                  #9
                  Originally posted by Rabbit
                  Let's get some more info.

                  How is your main report set up?
                  How if your sub report set up?
                  What's in each section of each report?
                  I wouldn't know how to go about explaining how it's set up - as you can see from my beginning that it didn't make much sense. What I up doing is creating the ID field as text and using last names instead of the auto number - since the ID fields are linked then the subreport alphebetizes the names since the ID code is their last name. Perhaps someone else will have this problem and will write in and will be able to explain better because I would like to know if it's possible. Thanks for your reply!

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    The reason I ask how it's set up is because it has an impact on how the report is rendered. But if you found a work around, that's good too.

                    Comment

                    • hjozinovic
                      New Member
                      • Oct 2007
                      • 167

                      #11
                      Hi there!

                      Have you tried to make a new query based on your Table 2. You can then sort records in that query and make it to be the record source for your subreport.

                      Just a thought....
                      Hrvoje

                      Comment

                      • rgsw
                        New Member
                        • Jul 2006
                        • 29

                        #12
                        Hi -

                        Yes I tried that too but didn't work. The fault I think is how it was set up. I just solved it by changing ID to text instead of numbers. Thanks for your reply.

                        Comment

                        • rgsw
                          New Member
                          • Jul 2006
                          • 29

                          #13
                          I'm such an idiot I can't believe I didn't think of this earlier....espe cially before I changed the ID's and it's so basic...but I created a query with Table2 AND Table1 then used that query for my report and I was able to sort everything in order.

                          Comment

                          Working...