Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50

    Unanswered: Cummulative Total

    I have created a form in Access 2000. The form has 4 fields (Currency type). When I enter / change a value of any of those fields, i want the TOTAL of those fields in the 5th field (which is a field to show the total). Only problem is, I have used Dirty option, so until i save the record, it does not show the total. I tried to use "before update", "on change", etc. for all those fields to add the current / changed value in the total field. I also tried to put the formula in form's "on current" event. I don't get the result as I want...
    Have any idia how could i get the total for those 4 fields for each reacord? I mean when i skip to next record, it should display the total field value, as the total of current 4 fields's value. (i am not sure I made it very clear to you guys or not...)

  2. #2
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    This may help

    Create a nwe Sub in the form

    Private Sub CalculateTotal()
    txtTotal = Textbox1 + TextBox2...
    End Sub

    Then for each textbox create an afterupdate event and call this sub.
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  3. #3
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50
    Thanks for your quick reply. Actually I need totals "Before update". Is there any way you could help me with, please??? Thanx...

  4. #4
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    I am not sure exactly what you mean.

    Do you want the total to be displayed when you enter the record?

    If so

    If the textbox is linked to a field call the function I posted before in the oncurrent event of the form the textboxes are on.

    If the textbox is not linked to a field why not just use a formula

    in Source of the total textbox type
    =Field1+Field2+Field3+Field4

    Hope this helps
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  5. #5
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50

    Cummulative total

    Well, Well, Well..... I don't understand why my mind doesn't work some times

    Actually totalling all 5 fields in the "total field" value worked! Everything looks so easy after one knows about it.

    Anyways, I thank you much for your time and help.

    Sandeep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •