Ms Access reverse data automatically??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xzorxx
    New Member
    • Dec 2013
    • 12

    Ms Access reverse data automatically??

    Hi...
    I have created MS Access database for stores management and every thing is okay, there is purchase table ,receive table ,transfer table and damage table .
    each one contain two table, now my problem is in the purchase table
    let's take a look please
    Code:
    first table 
    sno     inv_no     date     supplier
    Code:
    second table
    sno     code     details    qty    price    discount     tot
    _______________ ___
    the first_table.sno is connected to the second_table.sn o
    one to many relationship
    _______________ ________
    and the database is connected to vb
    I have created report ,and what is happening is..

    Code:
    first table 
    sno     inv_no     date        supplier
    1         0000      13-12-16    bla bla bla
    Code:
    second table
    sno     code     details    qty    price    discount     tot
    1        01        hammer    4       10        0          40
    2        02        screw     1       10        0          10
    3        03        bottle    2        5        0          10
    now when I print report it will reverse automatically, like this...

    Code:
    sno     code     details    qty    price    discount     tot
    3        03        bottle    2        5        0          10
    2        02        screw     1       10        0          10
    1        01        hammer    4       10        0          40
    Please help me...
    thank you in advance...
    Last edited by zmbd; Dec 17 '13, 05:13 PM. Reason: [z{Please format script and tables using the [CODE/] format button}]
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    In the record source for the report, have it order by sno.

    Comment

    • xzorxx
      New Member
      • Dec 2013
      • 12

      #3
      thank you for your reply ...
      order by sno, did nothing.

      Last edited by zmbd; Dec 17 '13, 05:07 PM. Reason: [z{third party sites are usually blocked for most of the experts; thus, mostly useless}]

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Can't see your image. It would help if you post your record source code.

        Comment

        • xzorxx
          New Member
          • Dec 2013
          • 12

          #5
          This is for filling table as you know

          Code:
          Me.Pu_it_QueryTableAdapter.Fill(Me.DbDDDataSet.pu_it_Query)
          And this is inside table adapter

          Code:
          SELECT Inv_no, Pu_date
             , P_no_pu, P_name
             , code, Item_details
             , price, qty
             , dic, Su_name
             , Sup_noT, U_name
             , Total, name
             , [For], Grandtot
             , totDes, Purchase_no
          FROM [pu_it Query]
          ORDER BY Purchase_no
          _______________ ___________
          and please don't forget that I have other tables with the same manner :), and they are work fine
          thank you for your patient..

          I should mention that ,in purchase table which user should use, is from tables in ms access and the report from query in same database
          ...
          Last edited by zmbd; Dec 17 '13, 05:15 PM. Reason: [z{Please format script and tables using the [CODE/] format button}] {Stepped the SQL for easier reading}{merged secondary post with this one}]

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            Code:
            ORDER BY Purchase_no
            for the momement place the field [Purchase_no] so that is visible in the records. Compare the order of the [Purchase_no] values to what you want.

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              I don't see this sno field that you referred to in your orignal post.

              Comment

              • xzorxx
                New Member
                • Dec 2013
                • 12

                #8
                Sorry rabbit I just used easy name instead of Purchase_no..
                thank you zmbd you mean putting the Purchase_no in the sub Table
                then order it.... I want it to be ordered to the user table order
                :( is that possible...
                and again don't forget I got other tables and it's just work fine
                Thank you ...

                Comment

                • xzorxx
                  New Member
                  • Dec 2013
                  • 12

                  #9
                  Deleted post useless
                  Last edited by zmbd; Dec 18 '13, 01:28 PM. Reason: [z{none of your images are available to most of the experts}]

                  Comment

                  • zmbd
                    Recognized Expert Moderator Expert
                    • Mar 2012
                    • 5501

                    #10
                    xzorxx :

                    None of the images you posted are available to myself and I suspect most of the experts here as we are normally at work PCs where IT policy will block image and file storage sites.
                    You were told about this by Rabbit in Post#4 and via the moderator's edit tag in your previous post.

                    The other thing, your post becomes worthless to others if the images in the third party site are ever deleted, the site goes down for any reason, or if they are also in the same boat where their IT dept blocks image and file storage sites.

                    Will you please, take the time to actually describe what you did?

                    Comment

                    • xzorxx
                      New Member
                      • Dec 2013
                      • 12

                      #11
                      Yeah sure, sorry about that
                      I fixed the database query to add serial no to the sub table then try to order it but nothing happened ..!!
                      then i was thinking about report expression could I reverse the data from it..?
                      that's it and sorry again
                      also you can delete the hole thing if it's not okay to your site sorry

                      Comment

                      • zmbd
                        Recognized Expert Moderator Expert
                        • Mar 2012
                        • 5501

                        #12
                        I fixed the database query to add serial no to the sub table then try to order it but nothing happened ..!!
                        Post the actual SQL

                        then i was thinking about report expression could I reverse the data from it..?
                        As you have this in the VB section and not Access/VBA, I'm not sure how to direct you here... normally in the Access program you can alter sort orders in the details section by altering the group/sort/total property

                        also you can delete the hole thing if it's not okay to your site sorry
                        Still would like to have the details instead of the pictures, if you would? We can replace the pics with the details.

                        Comment

                        • xzorxx
                          New Member
                          • Dec 2013
                          • 12

                          #13
                          Sure replace it please...

                          This is the SQL
                          Code:
                          SELECT Purchase_T.Purchase_no, Purchase_T.Inv_no, Purchase_T.Pu_date, Purchase_T.P_no_pu, Projects_T.P_name, Purchaser_T.name, Purchase_T.Sup_noT, Suppliers_T.Su_name, Purchase_T.For, pu_it.pu_no, pu_it.code, Item_T.Item_details, Units_T.U_name, pu_it.qty, pu_it.price, pu_it.dic, [qty]*[price]-[dic] AS Total, Purchase_T.totDes, [Total]-[totDes] AS Grandtot
                          FROM Units_T INNER JOIN (Suppliers_T INNER JOIN (Purchaser_T INNER JOIN ((Projects_T INNER JOIN Purchase_T ON Projects_T.P_no=Purchase_T.P_no_pu) INNER JOIN (Item_T INNER JOIN pu_it ON Item_T.Codeit=pu_it.code) ON Purchase_T.Purchase_no=pu_it.pu_no) ON Purchaser_T.Purchaser_no=Purchase_T.Purchaser_noT) ON Suppliers_T.Sup_no=Purchase_T.Sup_noT) ON Units_T.U_no=Item_T.U_no
                          ORDER BY Purchase_T.Purchase_no;

                          Comment

                          • Rabbit
                            Recognized Expert MVP
                            • Jan 2007
                            • 12517

                            #14
                            How come the most recent query is so different from the first query you posted in #5?

                            Comment

                            • xzorxx
                              New Member
                              • Dec 2013
                              • 12

                              #15
                              I am truly sorry mr.Rabbit the first SQL code from vb
                              second from ms access db..!!

                              good news is Just minute ago I have solve the problem I recreated the Purchase Query from 0 again ,and now it's work fine..!!

                              thank you very much

                              Comment

                              Working...