Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Reports: totalling an unbound column (2002)

    I have a report that lists all investment records by Type. I list the Maturity Value and Maturity date for all active investments. The last column lists the Maturity Value for the Investments that mature in the period specified (ie current year) only. The records that mature after the period display a zero. This column (Me.MaturityDate) is an unbound object and in the report detail section
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: totalling an unbound column (2002)

    1. There seems to be a bit of confusion here: "This column (Me.MaturityDate) is an unbound object" - don't you mean DispMaturityValue?
    2. You never set DispMaturityValue to anything else than 0, so it seems a pretty useless column. You should have an Else part:
    3. Since DispMaturityValue is unbound, you'll have to keep track of the subtotals yourself.

    a. Define a variable at the top of the report module to store the subtotal:

    Private curSubTotal As Currency ' if it needs to be currency.

    b. Put a text box txtSubTotal in the group footer.

    c. Add code to the On Format event handler of the detail section to set the subtotal:

    If Me.MaturityDate > Forms!frmReportDateRange!EndingRptDate Then
    Me.DispMaturityValue = 0
    Else
    Me.DispMaturityValue = ???
    End If
    curSubTotal = curSubTotal + Me.DispMaturityValue

    d. Add code to the On Format event handler of the group footer to set txtsubTotal, and to reset the variable:

    ' Set value of subtotal text box
    Me.txtSubtotal = curSubTotal
    ' Reset subtotal variable for next group
    curSubTotal = 0

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Reports: totalling an unbound column (2002)

    You're right the unbound object is DispMaturityValue. The else part sets the DispMaturityValue to Me.MaturityValue if the MaturityDate is within the report ending period. Once I got that fixed up and added your suggestions, it worked fine. I had tried the subtotalling thing before within the Detail_Format section but didn't know how to use the result of SubTotal in the footer . I now know to define that variable so I can use it throughout the module.

    Thanks so much.

Posting Permissions

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