Results 1 to 4 of 4

Thread: Running Totals

  1. #1
    Join Date
    Mar 2004
    Posts
    51

    Exclamation Unanswered: Running Totals

    Ok, here is the situation. I have a field called "Received YTD". This field is supposed to keep track of the amount of money a customer has received up to that point for the year. My question is, how do I keep a running tally for that specific customer as the user continues to enter data in an "Amount" field every month or so and then have it turn back to $0 once it hits January 1st? This needs to happen automatically. So I guess is really two questions about the running tally and turning it back to $0 January 1st. I would just use a counter but the user can enter an amount any number of times so that would not work in this instance.

    Thank you for all your help.

  2. #2
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520

    WARNING: I am not an expert.

    First: Please read the title of my reply.
    Second : Are you A) only keeping the total amount paid to the customer or B) keeping each payment to the customer stored and you want a total?

    Method A) Have a field in your table called “last_payment_date” or the like. On your entry form have a text box to enter the current payment amount. Tell your code to check the current date and compare it to the field “Last_payment_date” if the year is different set the field that contains the payment made to zero. (zero not NULL) Have your code run an update query to add the text field in your form to the amount paid field in the table. And have it update the “Last_payment_date” to the current date.

    Method B) Make a separate Table. Run your queries accordingly.
    Darasen

  3. #3
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Just another quick thought this would not be a good idea for a field in your data as youd have to run update queries each time a row was added or data changed etc.
    Why not just write a query to calculate what you want and then base your forms reports off of that

  4. #4
    Join Date
    Mar 2004
    Posts
    51
    Thanks guys. I've got it working and all is good It works fantastically. This forum always helps a lot when you get stuck on those little naggy things that just won't go away It always helps to have others to kind of put new ideas out there that you didn't think of. Thanks guys.

Posting Permissions

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