Strange summing results in a report

optidisk

Registered User.
Local time
Tomorrow, 02:41
Joined
Oct 18, 2005
Messages
32
Hi,

I have a report that derives it's data from a query, one particular field is giving strange results under certain conditions;
1. The field in the query contains this formula -
Vol: IIf([grade]="P",DLookUp("volume","tblpoles","length =" & [length] & " And " & "cdub =" & [cdub]),3.141593*[RAD]^2*[Length]/100000)
The report is then generated from a form which has the query as a sub form by clicking a button.
2. The field in the report which is posing a problem is the Vol field which contains this formula -
=Sum(IIf([Grade]="P",Forms!PropertyLogDocketMainForm!qryLogDocketSubForm.Form!Vol,Null))
The way that the subform works is that multiple items are entered with various codes in the grade field, all other codes work fine except "P" which has a seperate table which holds the set "volume".
What is happening is that if the user enters multiple rows in the subform of "P" grade items and clicks the report button, the field that holds the formula in item 2, instead of summing the "Vol" it is multplying the "Vol" in the first row by the number of times "P" appears, this makes no sense to me what so ever, these two formulas are the only two that have any bearing on the results that should appear in the report.
If more info is needed to decipher this unusual event please let me know, I am trying to isolate the tables and queries so I can post them here.

Cheers
Optidisk
 
I am unable to get the database that is causing the problem zipped below 1.1Mb. If anyone wants to have a look at the problem I can email the zip to you direct.
To use it go to the main switchboard and click the Open Log Dockets option, in the log dockets form use the search feature at the top to find 01478 or 01652 and click search.
The problem arises when you click the Royalty invoice button it doesn't sum the volumes.
cheers
optidisk
 
Managed to zip it small enough

I managed to remove all non essential forms/reports etc and converted it to 2003 format and I got it zipped small enough.
 

Attachments

Users who are viewing this thread

Back
Top Bottom