having trouble with a calc field (1 Viewer)

E

elektra

Guest
I have a form field that is not working correctly. The form is simply a listing of business transactions for a given year. It includes information such as total commission earned, total sales, number of warranties, etc. All of those are working fine. I also have a Count() field which simply shows how many transactions there are.

I want to calculate the percentage of transactions that had home warranties. This should not be a problem since the commission totals is working correctly, as well as the returned record count. Right now I'm using the following equation for the control source of the %homewarranties field: =Abs([WarrantySum]/[Count])

WarrantySum and Count are simply the field names of calc. fields that are working correctly. But the value returned by my %Warranties field is wrong. I know by doing my own math that the there are 10 warranties and 11 transactions, which should be about 91% transactions having warranties, but the field returns 33.33%. Btw, the format is percentage.

Can somebody help? I'm new at these calc. fields...thanks!
 

shacket

Registered User.
Local time
Today, 22:03
Joined
Dec 19, 2000
Messages
218
It can get tricky using calculations. I always get confused as to whether to use the field name or the control name. Try putting the two numbers you want ([WarrantySum] and [Count]) in calculated controls in the form header or footer (if you are using continuous forms) and then dividing the controls (rather than the fields). You can always make those controls invisible if you don't need to see them.
 
E

elektra

Guest
thanks shacket,

it was a problem with one of my field names ... didn't realize how finicky the "count" name would be...can't believe it was that simple...oh well! it works fabulously now!
 

Users who are viewing this thread

Top Bottom