Results 1 to 5 of 5
  1. #1
    tbjmobile@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    127

    Report print preview has random errors where the report view doesn't.

    I've made a report that I'm happy with and it has 2 sub-reports and lots of calculations.
    When I view it in Report view it is fine, whether the outcome is 'Total to pay' or 'Account in credit' but when I view it in Print preview or when I print it, I have errors. This isn't on all the individual reports, it's random as far as I can see. In the sub-reports, amounts that were zero always have the #error message which I guess I can get around with an IIf or NZ function. The totals though have a #Type! error. I have made sure that there is more than enough space to accommodate the field result and this one is truly random.
    I feel that this will be a common question but I can't find and answers on the forum.


    Thanks in advance for any help/ideas.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    what does the query show? if the query has no errors, then the report shouldnt either.
    any math with a null will give null. (not an error)
    any math with a string will give #type err.

    if you are doing math IN the rpt (not the query) then make sure you use the text box name, NOT the fieldnames.
    txtSpeed = SumDist / SumTime

    even tho there are 2 fields: SumDist & SumTime in the query, you cannot do the math unless there is a text box on the report holding that field.
    they dont have to be visible, but they do have to be on the report else you get an error.

  3. #3
    tbjmobile@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    127
    Hello Ranman,
    Thanks for helping. The report is a monthly account which only has 10 dummy entries in it, which represent all the eventualities that I can think of, that could occur. All but 2 of the math items on the report are calculated text boxes. The 2 that are actual fields work properly throughout. There is also a customer number field. You ask if the sub-reports function properly, so I have looked through all the full printed reports. The sub reports (2) work properly in all instances where there is data. The sub-report totals are in the main report ans refer to total boxes in the sub-report footers. However I have spotted a pattern, in that if there is no data in either sub-report, an #Error is produced and it is only those main report textboxes that have the other #Type! error in the subtotal, tax, grand total and amount owed lines.
    Now the Total now owed text box is calculated using the 'Balance before this account' amount, which in turn is calculated from the 2 fields, namely 'Bforward' minus 'Received'. I suppose you would recommend changing these first two fields with text boxes, in which case would the expression be something like bfd = Bforward the latter being the actual fieldname in the table. And then the same with the Received field ?
    Thanks, Trevor.

  4. #4
    tbjmobile@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    127
    Hello Ranman,
    Thanks for helping. The report is a monthly account which only has 10 dummy entries in it, which represent all the eventualities that I can think of, that could occur. All but 2 of the math items on the report are calculated text boxes. The 2 that are actual fields work properly throughout. There is also a customer number field. You ask if the sub-reports function properly, so I have looked through all the full printed reports. The sub reports (2) work properly in all instances where there is data. The sub-report totals are in the main report ans refer to total boxes in the sub-report footers. However I have spotted a pattern, in that if there is no data in either sub-report, an #Error is produced and it is only those main report textboxes that have the other #Type! error in the subtotal, tax, grand total and amount owed lines.
    Now the Total now owed text box is calculated using the 'Balance before this account' amount, which in turn is calculated from the 2 fields, namely 'Bforward' minus 'Received'. I suppose you would recommend changing these first two fields with text boxes, in which case would the expression be something like bfd = Bforward the latter being the actual fieldname in the table. And then the same with the Received field ?
    Thanks, Trevor.

  5. #5
    tbjmobile@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    127
    I have just looked at one of the suggestions automatically posted under the thread although I didn't find it in my searches - namely Report has no errors in Report View but has Errors in Print Preview

    By douglasfox in forum Reports

    I have no problem with showing a zero as a total for a sub-report with no data and it sounds as if that would solve my problem. So I need the keywords for IIf nodata, then total = €0.00
    or IIf total = "#Error" then total = €0.00

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

Similar Threads

  1. Data changes from Report View to Print Preview
    By AccessPadawan86 in forum Reports
    Replies: 9
    Last Post: 07-24-2017, 08:49 AM
  2. Replies: 3
    Last Post: 04-28-2017, 09:51 AM
  3. Switch from Print Preview to Report View
    By MatthewR in forum Reports
    Replies: 5
    Last Post: 10-20-2015, 12:40 PM
  4. convert report view to print preview
    By DarrenUD in forum Reports
    Replies: 3
    Last Post: 03-19-2013, 12:21 AM
  5. Replies: 10
    Last Post: 07-25-2011, 12:07 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