how can i update a calculated field in a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • annakalli
    New Member
    • May 2010
    • 34

    how can i update a calculated field in a report

    I have a table called banktransaction s in this table i have the following fields
    date
    details
    dramount
    cramount

    i am using this table to create a report showing the transactions for a given period. the report asks for the starting date and then for the ending date and automatically displays the fields details - dramount and cramount field for that period. i want to include in my report a new field which will be called balance brought forward and it will be the total of the previous dramount field - cramount field for the period before the starting date.

    for example i have the following data
    date details dramount cramount

    1/1/2011 payment1 35

    3/1/2011 payment2 45

    3/1/2011 receipt1 100

    10/2/2011 payment3 20

    15/2/2011 receipt2 40

    18/2/2011 payment4 10

    if i give as a starting date the 01/02/11 and as an endinf date the 28/2/2011 i want to have the following result in my report.

    balance brought forward
    20
    date detail dramount cramount

    10/2/2011 payment3 20

    15/2/2011 receipt2 40

    18/2/2011 payment4 10

    new balance 30

    please someone help because i am stuck
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Access reports have a feature (TextBox.RunningSum) whereby a tally can be kept of the calculations so far.

    Comment

    • annakalli
      New Member
      • May 2010
      • 34

      #3
      I am using the running sum for the totals of the dramount and cramount fields, i can figure out how i am going to have the total for the previous month as i explain above
      Last edited by NeoPa; Feb 8 '12, 12:33 AM. Reason: Removed unnecessary quote

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        Instead of filtering the report as you normally would, so only those records that appear on or after the start date are included, process the data from the start and simply cancel the printing if the date is prior to your specified start date.

        Code:
        Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
            If Me.Date < datStartDate Then Cancel = True
        End Sub

        Comment

        • annakalli
          New Member
          • May 2010
          • 34

          #5
          Is working fine now, thank u. The only thing that i can not manage is the field balance brought forwardwhat command shall i use in order to have automativally there the result of the calculation [dramount]-[cramount] for the dates before my starting date

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Your control where this is calculated, and which has .RunningSum set as True, should reflect this already if it's been set up correctly as explained.

            Comment

            Working...