A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error on no data



 
 
Thread Tools Display Modes
  #1  
Old September 18th, 2005, 06:44 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default #Error on no data

I have a report that works great when there is some information from the
query that supplies the data. However, if there is no data available then
the form produces the #Error message is various places. Is there a way to
prevent this something on the lines of ISError?

Am I close to the idea and if so where would be the best place to put the
code? Many thanks for taking the time to ready this. Any and all help much
appreciated.

Debbie D.

  #2  
Old September 18th, 2005, 07:12 PM
Ofer
external usenet poster
 
Posts: n/a
Default

Instead of taking care of the error, display a message that there is no data
to display, and close the report

On the OnNoData Property of the report write the code

MsgBox "No Data"
Cancel = True

--
I hope that helped
Good luck


"Debbie D." wrote:

I have a report that works great when there is some information from the
query that supplies the data. However, if there is no data available then
the form produces the #Error message is various places. Is there a way to
prevent this something on the lines of ISError?

Am I close to the idea and if so where would be the best place to put the
code? Many thanks for taking the time to ready this. Any and all help much
appreciated.

Debbie D.

  #3  
Old September 18th, 2005, 07:22 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default

Debbie D. wrote:

I have a report that works great when there is some information from the
query that supplies the data. However, if there is no data available then
the form produces the #Error message is various places. Is there a way to
prevent this something on the lines of ISError?

Am I close to the idea and if so where would be the best place to put the
code? Many thanks for taking the time to ready this. Any and all help much
appreciated.



Presumably, the #Error is appearing in a text box that
refers to a total text box's value in the subreport's
header/footer section.

If that's a valid deduction, then the main report text box's
expression should be along these lines.

=IIf(subreport.Report.HasData, subreport.Report.total, 0)

--
Marsh
MVP [MS Access]
  #4  
Old September 18th, 2005, 07:37 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default

Ofer,

Thanks, worked great!

"Ofer" wrote:

Instead of taking care of the error, display a message that there is no data
to display, and close the report

On the OnNoData Property of the report write the code

MsgBox "No Data"
Cancel = True

--
I hope that helped
Good luck


"Debbie D." wrote:

I have a report that works great when there is some information from the
query that supplies the data. However, if there is no data available then
the form produces the #Error message is various places. Is there a way to
prevent this something on the lines of ISError?

Am I close to the idea and if so where would be the best place to put the
code? Many thanks for taking the time to ready this. Any and all help much
appreciated.

Debbie D.

  #5  
Old September 18th, 2005, 07:38 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default

Marshall,

Have now tried both of the inputs from this question that you kindly
answered. Works great. Thanks!!

"Marshall Barton" wrote:

Debbie D. wrote:

I have a report that works great when there is some information from the
query that supplies the data. However, if there is no data available then
the form produces the #Error message is various places. Is there a way to
prevent this something on the lines of ISError?

Am I close to the idea and if so where would be the best place to put the
code? Many thanks for taking the time to ready this. Any and all help much
appreciated.



Presumably, the #Error is appearing in a text box that
refers to a total text box's value in the subreport's
header/footer section.

If that's a valid deduction, then the main report text box's
expression should be along these lines.

=IIf(subreport.Report.HasData, subreport.Report.total, 0)

--
Marsh
MVP [MS Access]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I save an access document in word document? cmartin General Discussion 2 September 13th, 2005 11:26 PM
Unable to have multiple queries feeding a single report PZ Straube Setting Up & Running Reports 15 June 15th, 2005 08:16 AM
Data Source issues. ??data.access.pages Phil Database Design 2 October 11th, 2004 02:42 AM
Data Source issues Philippe Database Design 1 October 10th, 2004 09:45 PM
How to create graphs in a monthly report where the base data can change John Clarke Charts and Charting 3 June 25th, 2004 02:22 AM


All times are GMT +1. The time now is 02:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.