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 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