Report from parameter query with #Error

G

Guest

Hello..I am building a report based on a parameter query. The parameter is a
date range. Everything is working correctly except when there are no records
in the date range specified. The result is correct...(as there are no records
in that date range)...but the parameter text box shows "#Error", instead of
the date range specified. I would like that the date range is given and
instead of just a blank report, that "No Records Found" is shown. I am at
novice level and appreciate all your suggestions. Thank you.
(Just to be clear, if a date range is given and there are records, then the
report shows the date range specified and the appropriate records are
listed...I am having a problem when there are no records in the date range.)
 
M

Marshall Barton

Kathy said:
Hello..I am building a report based on a parameter query. The parameter is a
date range. Everything is working correctly except when there are no records
in the date range specified. The result is correct...(as there are no records
in that date range)...but the parameter text box shows "#Error", instead of
the date range specified. I would like that the date range is given and
instead of just a blank report, that "No Records Found" is shown. I am at
novice level and appreciate all your suggestions. Thank you.
(Just to be clear, if a date range is given and there are records, then the
report shows the date range specified and the appropriate records are
listed...I am having a problem when there are no records in the date range.)


Us an expression like this in the data range text box:

=IIf(Report.HasData, [Start date] & " to " & [End Date], "No
records found")

Make sure that the text in the [ ] is **exactly** the same
as the prompt strings in the query.
 
G

Guest

That was it...thank you. Little things mean a lot!
--
Kbelo


Marshall Barton said:
Kathy said:
Hello..I am building a report based on a parameter query. The parameter is a
date range. Everything is working correctly except when there are no records
in the date range specified. The result is correct...(as there are no records
in that date range)...but the parameter text box shows "#Error", instead of
the date range specified. I would like that the date range is given and
instead of just a blank report, that "No Records Found" is shown. I am at
novice level and appreciate all your suggestions. Thank you.
(Just to be clear, if a date range is given and there are records, then the
report shows the date range specified and the appropriate records are
listed...I am having a problem when there are no records in the date range.)


Us an expression like this in the data range text box:

=IIf(Report.HasData, [Start date] & " to " & [End Date], "No
records found")

Make sure that the text in the [ ] is **exactly** the same
as the prompt strings in the query.
 

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