On Error - Query to Report - no records

C

c8tz

hi,

i have a query such that within a date range it puts on a report
certain info.

problem is : when there is no record - on the report shows #error
under each column for report. I've tried an example given such that
it shows a Label "no records for this date period" - which works but
still showing the #error #error etc.
How do I hide the data ..ie #error and show only the label - or better
yet , change these #error to show 0.00

i tried using Nz(Amt) in underlying query but still not working.

Many thanks for all help given.
 
A

Allen Browne

Try:
=IIf([Report].[HasData], Sum([Amt]), Null)

The only thing to change in that expression is to use for field name in
place of Amt.

Explanation:
Avoid #Error in form/report with no records
at:
http://allenbrowne.com/RecordCountError.html

An alternative approach is to cancel the report's NoData event so it doesn't
open if there are no records.
 
C

c8tz

Try:
    =IIf([Report].[HasData], Sum([Amt]), Null)

The only thing to change in that expression is to use for field name in
place of Amt.

Explanation:
    Avoid #Error in form/report with no records
at:
   http://allenbrowne.com/RecordCountError.html

An alternative approach is to cancel the report's NoData event so it doesn't
open if there are no records.

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.






i have a query such that within a date range it puts on a report
certain info.
problem is : when there is no record - on the report shows #error
under each column for report.  I've tried an example given such that
it shows a Label "no records for this date period" - which works but
still showing the #error #error etc.
How do I hide the data ..ie #error and show only the label - or better
yet , change these #error to show 0.00
i tried using Nz(Amt) in underlying query but still not working.
Many thanks for all help given.- Hide quoted text -

- Show quoted text -

Thanks heaps - will try it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top