#error in textbox occasionally

Sketchin

Registered User.
Local time
Today, 04:21
Joined
Dec 20, 2011
Messages
580
Hi there,

I am trying to track down the cause of a #ERROR in one of my textboxes that has the control source set to:
=(DCount("[UniqryFiscalUsageToDateDashboardNew].[BOMDescription]","2ndQryPercentageBOMUsageFiscal_new"))/(DCount("BOMID","2ndQryPercentageBOMUsageFiscal_New"))

The textbox sometimes returns a value when I open the form, and sometimes returns #ERROR. This form opens when I first run the database and the error shows up regardless of whether or not I made any changes in the database. I could open and close it 10 times and it would give me #ERROR probably 7 of 10 times.

Im convinced its that I am doing this calculation in the wrong place, and am totally open to suggestions on other ways to do this.

Thanks,
 
It looks like you are getting both counts from the same query

2ndQryPercentageBOMUsageFiscal_new

Presumably you are trying to determine the number of records where[UniqryFiscalUsageToDateDashboardNew].[BOMDescription] is not null expressed as a percentage of the total number of records?

If so, maybe you are getting a division by zero error if there are no records?

Why not try splitting each part of the calculation into two separate text boxes and see what the values are
 

Users who are viewing this thread

Back
Top Bottom