Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#error result in a report?????????

Status
Not open for further replies.

Tmconsult

IS-IT--Management
Jul 25, 2001
88
0
0
US
I have 2 small problems, hopefully someone can help me with. 1) I have a report which has calculations in them for many people. Sometimes though a person may not have data, and when you run the report you get a bunch of numbers as results but sometimes you get #error, im assuming its because there is no data to work with. is there any way to make this not show up. 2) I have set my text boxes which calculate results to 0 decimals in properties, but when I run it I get up to five decimals (ex 4.56432) why?
 
I think I may be able to help you on Question 2. Somewhere in your database you have specified that the field read 5 decimals despite the fact that you have your text box set to 0 decimals. It's most likely the table you have your textbox writing to.
 
On 2, yes, that would most likely be your table that has the five decimal places set. on your errors; you are correct that Access sends #error when it cannot find information for a report. I believe you can put an if statement in your code that can specify if no data is available then to print nothing or a message saying there is no information available. Hope this helps you out. Mooo... :)
 
Open up your report. Go to properties for the entire report and go to the event procedure for On No Data. In here you can add code to make any field visible or invisible when there is no data.

eg. me.text45.visible = true or false

Now when you run the report, the text box called 'text45' will be either visible or hidden depending on what you coded.

Hope this helps.
 
1. Often you will get #Error if you have a calculation and there is null data in one of the fields. I get around this by using the Nz function. Like =Nz([anyfield],0) * 5

2. Try setting the Format property of the textbox to "Fixed". I find that Access often ignores the Decimals property depending on the Format setting.

Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top