Results 1 to 3 of 3

Thread: [RESOLVED] Data Report Totals

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Resolved [RESOLVED] Data Report Totals

    Ok ive searched and searched and searched.....then i searched some more.....
    im getting my values from 1 table

    VB Code:
    1. sstr = "Select IVat1, IVat2, IVat3, IVat, OvertimeVat From Invoice " _
    2.             & "Where InvoiceDate Between " & "#" & dDate1 & "#" & " AND " & "#" & dDate2 & "#"

    All i want to do is add up the vat fields, then display the Vat total in a Label on my datareport, then move on to the next record. but i cant seem to get it to work

    values would be something like
    IVat1, IVat2, IVat3, IVat, OvertimeVat
    10, 1, 2, 45, 10

    Total should then be 68...

    then next record would be
    IVat1, IVat2, IVat3, IVat, OvertimeVat
    5, 7, 10, 5, 9

    Total should then be 36...

    but instead of giving two different totals....i keep getting the same total.....68?

    all ive done is said
    VB Code:
    1. .Sections("Section1").Controls("Label31").Caption = cdbl(rsx!IVat1) + cdbl(rsx!IVat2) +
    2. cdbl(rsx!IVat3) + cdbl(rsx!IVat) + cdbl(rsx!OvertimeVat)

    please help

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Data Report Totals

    Moved to reporting section

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Data Report Totals

    Data Reports is pretty limited. You cannot create a user defined formula (which is basically what you are attempting) for each record.

    Data Reports does have the Function control but that control can only be placed in the Report Footer or Group Footer sections.

    Do the totalling in your sql statement. Then add a textbox to the Details section bound to this new field.

Posting Permissions

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



Click Here to Expand Forum to Full Width