473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

#Error on a Report

Hello,

I need help on getting rid of #Error in my fields on a report when no data exist. I was using the below formula:

="" & [System] //is a field of text type from table1

and when #Error showed I switched over to

=IIf(IsNull([System])," ",[System])

and that came up with the same results. If data exist it works fine but when data is not there I want it to be blank or say "No data exist".

What formula can I use in the control source on this report to fix this. Any assistance would be most appreciative.

Thanks
Mar 16 '08 #1
3 1199
Stewart Ross
2,545 Expert Mod 2GB
Hi David. You have double-posted a thread on the same topic, which is not appropriate nor courteous to the respondents (see http://www.thescripts.com/forum/thread783265.html).

If you are using a calculated control on a report make sure that its name is not set to be the same as the field you are referring to. You mention [system], so make sure the calculated field's name is not also system. You will undoubtedly receive a #Error if you try to refer in a calculated control to a field name which is the same as the control itself - it's a circular reference. Name the calculated textbox something else such as TheSystem or whatever you think is appropriate, just make sure it is a different name from that of the field you are testing.

In its control source property just enter =Nz([system]) to return a blank if the system field is null.

If you want to return a more specific message, then change this to
=Nz([system], "Field is null") or whatever suits.

-Stewart
Mar 16 '08 #2
Hi David. You have double-posted a thread on the same topic, which is not appropriate nor courteous to the respondents (see http://www.thescripts.com/forum/thread783265.html).

If you are using a calculated control on a report make sure that its name is not set to be the same as the field you are referring to. You mention [system], so make sure the calculated field's name is not also system. You will undoubtedly receive a #Error if you try to refer in a calculated control to a field name which is the same as the control itself - it's a circular reference. Name the calculated textbox something else such as TheSystem or whatever you think is appropriate, just make sure it is a different name from that of the field you are testing.

In its control source property just enter =Nz([system]) to return a blank if the system field is null.

If you want to return a more specific message, then change this to
=Nz([system], "Field is null") or whatever suits.

-Stewart

Stewart,

No names are the same but I did use your code but it still produces #Error. Can't figure it out. It works great if data is there with any of my codes as well as the one you gave me but with no data it continues to come up with #Error in the text box. Any other things that could cause this?

David
Mar 16 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi David. As NeoPa said in the other thread, there is something else amiss here. Nulls cannot of themselves cause #Error results in a report. There are some circumstances in which it can occur: when the field cannot be evaluated (as a result of a circular reference, or some other issue with the expression for that field), or when there is an illegal action such as division by zero taking place either directly within the expression for that item on the report, or indirectly within any of the queries feeding in to the report's source. Without knowing more about your report and the source query I would only be guessing if I tried to be more specific.

-Stewart

ps I see from the other thread that in fact it was an empty dataset problem - no records to report. From your attempts to test for nulls on individual fields it had seemed to me that you had #Error occurring on some, but not all, fields - how wrong to interpret it that way.

I chose not to delete this thread when I noted the double-posting; I would advise that the thread should now be treatead as closed, however!
Mar 17 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: xixi | last post by:
we are using db2 udb v8.1 on win 64 bit with fp3 with type 4 db2jcc.jar driver. such error generated , please help me understand this , thanks 2004-01-12-14.09.02.400000 Instance:DB2 ...
6
by: Alixx Skevington | last post by:
OK why does the following code work in a Windows form with a crystal report viewer but not in a webform. I get the usual CrystalReports.EngineLogONException logon Failed when this is called in...
0
by: Simon | last post by:
Hi I try to open a CR report file located on the network path from a web form developed with vs2003 and CR for Visual Studio, but the Load method of ReportDocument object always return error. ...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
0
by: smkkaleem | last post by:
I am stuck with the error I have posted above in the question title I am developing ASP.NET 2.0 web site and I have added a new rdlc file to my project by using the following process: -Right...
2
by: Miguel | last post by:
I have reviewed the many postings on this topic and understand the principle, but am not sure where in my case to apply trapping an error. I have created a form to supply parameters to a report. I...
8
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report...
17
by: =?Utf-8?B?SGVyYg==?= | last post by:
I have created a report and subreport in VB/ASP.NET. The report works fine but the subreport will not display. The subreport, when displayed as a standalone report, works fine. Any help I can...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.