Results 1 to 6 of 6

Thread: Reports: Sums

  1. #1
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379

    Unanswered: Reports: Sums

    All,

    All the help & HOWTOs say you can get subtotal from groupings and grand totals with the use of:

    =sum([fieldname])

    and I have used this in the past, but current report is erroring by giving the popup, asking for value entry on each of these I placed in the report.

    I'm guessing this is a reference or config problem at the Access or Office level.

    Does anyone know what is causing this and how to correct it?

    DBS4M
    Last edited by dbsupport4me; 07-30-09 at 09:27.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    check the syntax, it should be the column name of the column you want to sum, not the control name, although with Access reports the 2 are often the same
    check your spelling
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379

    Not the Problem

    H,

    Not the problem as I used the expression builder and pulled it directly from the current report form.

    Any other ideas?

    Thanks!

    DBS4M

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    well thats the only times I've had this issue.. when the column name was wrongly spellt or missing fromt he underlying query

    so if thats not fixed it, then I'm out of ideas...
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379

    What I tried

    All,

    Found and followed HOWTO at:

    http://office.microsoft.com/en-us/ac...224441033.aspx

    and had encountered some problems setting date fields on the report, which I resolved with HOTOW at:

    How to assign values to Unbound Text box in Report thru VBA code ? - bytes

    using the function set of:

    =myfunction()

    which worked fine.

    Wondering if I have to also do this in the same manner, so looked up help on DSUM, but was not able to make it work right, because that tends to pull sum for entire report, not by the grouping section.

    Any ideas on that would get me past this.

    Thanks!

    DBS4M

  6. #6
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379

    Code

    All,

    Here is the code I have in the report so far:
    Code:
    Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
        Call CliSbT([tboxCLI])
    End Sub
    Private Sub GroupFooter1_Print(Cancel As Integer, PrintCount As Integer)
    '    Call CliSbT([tboxCLI])
    End Sub
    Private Sub Report_Open(Cancel As Integer)
    End Sub
    Function BegDate() As Date
        BegDate = FrmSDate
    End Function
    Function EndDate() As Date
        EndDate = FrmEDate
    End Function
    Function CliSbT(myClient)
        Dim FMTbeg, FMTend, WHRstr
        FMTbeg = DateSerial(Year(FrmSDate), Month(FrmSDate), Day(FrmSDate))
        FMTend = DateSerial(Year(FrmEDate), Month(FrmEDate), Day(FrmEDate))
        WHRstr = "(([tmp_cnm] = '" & myClient & "')) AND " & _
                 "((([tmp_wdt] >= #" & FMTbeg & "# AND [tmp_wdt] <= #" & FMTend & "#)) OR " & _
                 "(([tmp_ted] >= #" & FMTbeg & "#) AND ([tmp_ted] <= #" & FMTend & "#)))"
        CliSbT = DSum("[tmp_bhr]*[tmp_wir]", "tmpREPfnr", WHRstr)
    End Function
    Function GrndTot()
    '    GrndTot DSum("[tmp_bhr]*[tmp_wir]", "tmpREPfnr",)
    End Function
    The function I'm working on for the subtotal by client is "CliSbT". Put break on the "End Function" line to check the values and got the right values for each section, but not geting correctly assigned in report so getting "#Name?" instead.

    Any ideas?

    DBS4M

Posting Permissions

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