Results 1 to 3 of 3
  1. #1
    paulh_36 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5

    Subreport not visable in preview mode unless it returns records, How to make subreport visable alway

    I am working with a 2003 database with Access 2010. I have a main report with both detail and total information (calculated fields) plus two sub-reports. The first sub-report retreives and summarizes data using a separate query while the second sub-report is a summary report that adds the totals generated by the main report and the first sub-report together. Everything works great in report mode, but fails to display the first sub-report nor generate the summary totals in preview mode if the first sub-report returns no data (which quite offen happens). How do I display the first sub-report and update my summary totals (the second sub-report) in preview mode so that I might print the entire report? Hope this all makes sense!



    Thank you very much for any help you might have.....

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    So this is normal behavior. One can deal with it either in the early stage or in the late stage. Right now you are looking at the late stage.

    Early stage solution is to insert a record into that record source - possibly with 0 values in the fields - that way the sub report will render plus any math that it is a part of will work. How do you insert a 0 record? ...well that depends on the structure of the data. Am just giving the overview for now.

    The late stage is fairly easy if no math is involved, but trickier when there is math. In the OnFormat event of the section that the sub report is located you can check its status dynamically with the HasData method. For non math situation one typically toggles visibility of a label saying something along the lines of "No Data for this Blah Blah" - just to keep the report from looking funky if there is an odd white space or something where a Can Shrink isn't enough. But if math is involved elsewhere in the report - then one must also insert calculation variation logic so that your calculation goes 1 way if there is data but another way if there is no data in order to avoid the malfunction blank....

  3. #3
    paulh_36 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    Thank you very much I will take a look. I did try the calculation logic (ex. checking for Null) but not the OnFormat event.

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

Similar Threads

  1. Make subreport read only on a form
    By BRZ-Ryan in forum Forms
    Replies: 2
    Last Post: 12-09-2013, 03:15 PM
  2. Copy and Paste non-visable field
    By delap009 in forum Forms
    Replies: 2
    Last Post: 08-22-2013, 10:23 AM
  3. Replies: 1
    Last Post: 04-15-2013, 10:02 AM
  4. Toggle Visable Text Box
    By sarahlouisej89 in forum Forms
    Replies: 1
    Last Post: 09-13-2012, 09:39 AM
  5. Replies: 1
    Last Post: 01-10-2011, 01:08 PM

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