Results 1 to 8 of 8
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Adding more "height" to a report

    Sorry about the title, but that's as close as I could come to the problem with this report. I am the patron saint of lost databases and on short notice I am taking over 20 year old application. One of the many quirks in this db is in the report design. The record source is a single row table with 60 columns. Each column is potentially another row on the report and are laid out manually. There's no sorting or grouping possible. Grouping is however being done using page breaks. The height of the report is 22", which appears to be the maximum height allowed. My task is to add several more rows to the report, but I've run out of real estate. In my ideal world I'd rework the entire report. Really, the entire db needs an overhaul, but I have about a week to turn this around.



    Subtotals are all calculated using VBA in the OnFormat event. Here's a sample. All those numeric values are field names from the table, each one of which has to be run through the NulltoZero function.

    Code:
    Me.OFee = NullToZero([O2106]) + NullToZero([O2101])
    Me.NetFees = [OFee] + NullToZero([O2107])
    Me.OFed = NullToZero([O1102]) + NullToZero([O1103]) + NullToZero([O1107]) + NullToZero([O1109]) + NullToZero([O1112]) + NullToZero([O1113]) + NullToZero([O1141]) + NullToZero([O1139])
    Me.NetAC = NullToZero([O5107]) + NullToZero([O5116])
    Me.NetFR = NullToZero([O5115]) + NullToZero([O5117])
    Me.NetDADS = NullToZero([O5121]) + NullToZero([O5122])
    Me.NetDAP = NullToZero([O5119]) + NullToZero([O5120])
    Me.NetCS = NullToZero([O5124]) + NullToZero([O5127])
    Me.NetRecovery = NullToZero([O5129]) + NullToZero([O5132])
    Me.NetTrans = NullToZero([O5130]) + NullToZero([O5133])
    
    
    
    
    Me.txttotalSMI = NullToZero([O1103]) + NullToZero([O1107]) + NullToZero([O1104])
    Me.OFedOther = NullToZero([O1139]) + NullToZero([O1141]) + txttotalSMI
    Me.txtTotalMHFBGSEDCAFunds = NullToZero([O1102])
    Me.txtTotalMHNetCrisisResponse = NullToZero([O5145]) + NullToZero([O5146])
    
    
    EOFedOther = NullToZero([EO1139]) + NullToZero([EO1141]) + NullToZero([EO9110])
    Me.OFed = Me.OFedOther + NullToZero([O1109]) + NullToZero([O1144]) + NullToZero([O1112]) + NullToZero([O1113]) + NullToZero([O1102]) + NullToZero([O1143])
    Me.OEFed = Me.EOFedOther + NullToZero([EO1109]) + NullToZero([EO1112]) + NullToZero([EO1113])
    
    
    Me.OUnRegional = NullToZero([O5129]) + NullToZero([O5142]) + NullToZero([O5139])
     
    Me.AcuteCare = NullToZero([O5107]) + NullToZero([O5116])
    
    
    Me.DAP = NullToZero([O5119]) + NullToZero([O5120])
    DAP2014 = NullToZero([O5150]) + NullToZero([O5151])
    
    
    Me.Crisis = NullToZero([O5124]) + NullToZero([O5155])
    Me.Transfer = NullToZero([O5162]) + NullToZero([O5163])

    Your comments are welcome.
    At this point I think I'm going to just crowd everything together to create enough space for a few new rows. I'll worry about pretty later.

    I just had to vent. It helped. I guarantee you I'll be back with more.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Hard to make any suggestions without seeing the report, so I think all you're going to get is stabs in the dark. You can't UNION any of these fields to present more report rows and base a new report on that query? There must be some sort of logic that determines where the page breaks are, so re-create that with a proper query? Or use columns in the report page setup? 8.5x14" paper instead of 8.5x11?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The height is what it is.

    Format event only triggers with PrintPreview or direct to printer, not ReportView.

    If you want to display null as 0, then why not use expression in textbox: =Nz([fieldname], 0).

    Or even simpler, select all textboxes and set Format property: #,###;;;0

    No VBA and report should perform faster.

    Ooops, I see now you are doing arithmetic and have to first convert nulls to zero so doesn't return null if any field contains null. But why call a custom function when Nz() is available?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I agree. The whole NulltoZero thing makes me laugh. I think it was needed to make the calculations work. It's all unnecessarily complicated. Working with older apps like this I can see the learning curve of the developer. I used to jump through some odd hoops when I was just learning. Still do.

    Nothing would make me happier than to rip the guts out of the app and rewrite, but that may be a bridge too far.

    Always nice to chat June.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Guess developer did not know about Nz(). I remember when I learned about Nz() - it was a 'Hallelujah' moment. Same when I learned about UNION query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You said db was 20 years old? Wondering how long Nz has been around, I found this at M$:

    Access for Microsoft 365 Access 2019 Access 2016 Access 2013 Access 2010 Access 2007

    So it wasn't available when that db was created, perhaps?
    EDIT - I discovered you can search based on date range and found at least one post from 2000 that referenced Nz so I guess that's not it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Leftfield suggestion and very much a kludge, but you can shrink the controls to virtually zero height, then set them to grow. The report will expand to accommodate them.

    Also any chance you could simply use sub reports with sets of the controls in them?
    These can also be set to zero height and grow = yes.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    Paul H's Avatar
    Paul H is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Quote Originally Posted by Minty View Post
    Leftfield suggestion and very much a kludge, but you can shrink the controls to virtually zero height, then set them to grow. The report will expand to accommodate them.

    Also any chance you could simply use sub reports with sets of the controls in them?
    These can also be set to zero height and grow = yes.
    Really, I'd like to re-engineer the whole thing, it needs it. That's what I love to do, but I'm in crisis mode and have to crank out these unnecessarily complicated (you wouldn't believe it) and deliver for testing next.

    Ranting here is my version of therapy.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding "grand total" of sub-totals in query or report
    By warminster100 in forum Queries
    Replies: 3
    Last Post: 07-02-2018, 10:36 AM
  2. Adding a "Refresh" Button to a Report
    By Sparkydog in forum Reports
    Replies: 1
    Last Post: 02-19-2018, 04:32 PM
  3. Replies: 2
    Last Post: 04-12-2016, 12:58 PM
  4. Adding "Count" Totals to Report
    By Ludovik in forum Reports
    Replies: 7
    Last Post: 11-02-2013, 01:09 PM
  5. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums