Results 1 to 11 of 11
  1. #1
    douglasfox is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    5

    Red face Report has no errors in Report View but has Errors in Print Preview

    HELP!!!!



    I have a report that has three subreports, each having a sum text box (subtotals). The main reports then sums the subtotals into a grand total. There will be cases where the subreport doesn't have any data.

    The problem is that, for some reason, the report works perfectly in Report View. When a subreport has no data, the subtotal is shown as 0 and the grand total works fine. But when I go to print it (or print preview), the subreport that has no data disappears and then the grand total shows "#Error".

    I would like to leave the subreport as visible even if there's no data in it (to explicitly show that there is no products in that category for the current quote).

    Can anybody help me???

    Thanks in advance.

    Doug

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well - I have a point of clarification which may or may not be related. Your post implies there being 3 states for a report: "Report View", "Print Preview" and "Print".

    There is only 2 states for a report (with values and summing taking place) - Print Preview & Print. The 3rd state is design view but for which there isn't any live data to be in error.

    what is your meaning of 'Report View' vs 'Preview'? most times one looks at a report on screen as Preview. Then if everything is ok - they print it. Sometimes, to save time, one never needs to preview it so they go direct to print.

    Not sure this helps but....

  3. #3
    douglasfox is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    5
    Thanks for the reply NTC. I've attached two screenshots to try to clarify what I mean.

    The first, entitled Report View, shows the view option that I'm using in Access 2007 and as you can see on that page there's no error in the grand total.

    The second, entitled Print Preview, shows the print preview screen and as you can see on that page there's an error in the grand total.

    I know that this is because the subreport that has no data is disappearing in the print preview (which I actually don't want it to do, I can't figure out how to make it stay). Since the grand total is a summation of the subtotals within the subreports, when the subreports disappear the grand total results in an error because it can't find a reference.

    How do I make the subreports stay even if there's no data in them.

    Thanks for your help.

    Doug

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well ok - that helped. from your original post I had the misunderstanding you were discussing 1 report in 2 different 'states' ; but from the view one can see these are 2 totally separate reports. So that the fact that it works in one, and not in the other isn't necessarily strange.

    We obviously can't see the code behind that control and can't say why it is throwing an error. Something is different. The generic #error typically means it is not finding the name of the other controls it is told to be looking for.

    You should be able to look behind the one that does work, and use that as a guide to fix or remake the other.

  5. #5
    douglasfox is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    5
    Hi NTC:

    They look like different reports in the screenshots, but it is actually the same report. The screenshots look different only because there are multiple pages to the report, when the subreport disappears it pushes the grand total line to page 2 (hence the difference in look of the two screenshots). Both screenshots are indeed the exact same report, just shown in two different views (i.e. Report View and Print Preview)!!!!!

  6. #6
    mgoldbla is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    1
    Doug

    Have you had any luck solving this? I encountered the exact same problem in Access 2010 and can't seem to get it fixed. I had found the following in a google search, which may help your particular situation since you are using 2007, but it didn't fix it in 2010.
    http://allenbrowne.com/RecordCountError.html

    -Michael

  7. #7
    douglasfox is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    5
    Michael:

    You are a life saver!!! Thank you so much for pointing me to this. It worked like a charm for me. I added in =IIf([subreportname].[Report].[HasData],[subreportname].[Report]![subtotalTextbox],0) into my main report and it now works perfectly.

    Thank you again for pointing this to me!

    Doug

  8. #8
    alaric01 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    17
    i've got the same problem here. not a complex code. my simple code of

    Code:
    Me.txt_jumlah_grand_total = "test"
    will show up in the report view but not in print preview.

  9. #9
    douglasfox is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    5
    Hi alaric,

    Sorry for responding with a question, but if you could give a little more detail maybe I can help. Where are you putting that code? I.e., in what event? What is it that you are testing/trying to accomplish?

    Doug

  10. #10
    KaptKos is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Lansing, MI
    Posts
    1
    Anyone find a remedy for this?

    I'm working with a report that has sub-reports in 2010 that
    wont appear in Print Preview mode either. My quick resolution
    was to add the icon for Quick Print to the ribbon and print the
    report from Report View. It worked but just curious.

    Thanks
    KaptKos

  11. #11
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    @KaptKos

    I'm not sure that is the best solution as in Report View the Format and Print events don't fire as those events are used when those individual sections are printed. With that in mind, exactly what is not working in Print Preview?

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

Similar Threads

  1. Replies: 0
    Last Post: 07-15-2010, 12:13 PM
  2. Can't see sub report in print preview
    By LoggyDoggy in forum Access
    Replies: 1
    Last Post: 04-20-2010, 05:38 PM
  3. Accessing Table via asp Errors
    By KLynch0803 in forum Programming
    Replies: 1
    Last Post: 01-17-2010, 09:59 AM
  4. .ocx Files Errors
    By darshita in forum Import/Export Data
    Replies: 9
    Last Post: 12-07-2009, 07:36 AM
  5. dialog box errors in report
    By Jane in forum Programming
    Replies: 0
    Last Post: 11-20-2008, 01:06 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