Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    68

    Unanswered: totals in a subform

    Hello, I have a subform that is used to enter time in hours for timekeeping purposes. The form displays the last 30 days worth of data. The subform is in Datasheet view similar to this:

    Date Project Hrs
    08/09/04 Project1 3
    08/09/04 Project2 4
    08/09/04 Project3 5
    08/10/04 Project1 4
    08/10/04 Project2 5

    I would like to have a running total of the number of house per day. I really don't know the best way to do this. Do you suggest having a subform that uses the date as the link? Or can I have a running sum column that starts a new count on a different date (that sounds complicated and confusing!)

    Your thoughts and ideas are greatly appreciated.

    Grace

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    What I do is have a "total" on the main form ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2004
    Posts
    68

    Totals by date ...

    How would I put a Total Hours on the main form? I tried creating a field on the main form that has a control source of: =Sum([subformLegalUserTimeTrackingdetail].[Forms].[Hours]) but that didn't work. I actually would like the totals to be by date. See the example below:

    Date Project Hours
    08/09 A 2
    08/09 B 4
    08/09 C 2
    08/10 A 2
    08/10 B 4
    08/10 C 5

    Total for 08/09 = 8
    Total for 08/10 = 11

    I don't know how to get the totals by date to display.

    thanks again for your help

  4. #4
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    The only way that I can think of you being able to get a total is to generate a report that does it, and or a query. M Owen's idea which I use when I need a running total of like prices or something wouldnt work in this instance unless you want 30 or 31 different fields depending on the month.

    Check into the query/report idea.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  5. #5
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    I believe you can put a textbox oin the subform's footer section and bound it to =Sum([FieldNameHere]), and you will get sum of the subform. then you can read this textbox' value and show in your main form. I didn't try this but it should work.
    ghozy.

  6. #6
    Join Date
    Mar 2004
    Posts
    68

    totals by date???

    Hi, Thanks for your help. Well, putting in the subform works but I first had to make the subform "Continuous" instead of "Datasheet".

    I get the total in the footer and it changes as new records are added, however, my "wish" is to have it sum by date. so that I have totals for each date.

    I think I need some code to do this.

    Thanks again for your help

  7. #7
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    it works in datasheet mode too, it just wont show up in the datasheet, you have to refrence it in your main form. if you want to see in datasheet you should put it into detail section. anyway maybe you should use something like IIf function.
    ghozy.

Posting Permissions

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