Calculated field in subform not returned in parent in v.2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following is failing: "=subform!calculatedfield-parentfield" the calculated field is coming in as zero, rather than the actual calculated amount. Is there a reason for this? The same thing is happening in reports/subreports. This is ONLY HAPPENING in version 2003. It works in all other versions I have tried. Does anyone know how I can fix this ASAP!!

Thanks!
 
Access sometimes does not understand the data type of a calculated field.

Assuming this is the ControlSource of a text box on the main form, try
typecasting, e.g.:
=CDbl(Nz([NameOfSubformControl].Form![NameOfCalculatedField],0)) -
[NameOfMainFormField]

Explanation in:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tom said:
The following is failing: "=subform!calculatedfield-parentfield" the
calculated field is coming in as zero, rather than the actual calculated
amount. Is there a reason for this? The same thing is happening in
reports/subreports. This is ONLY HAPPENING in version 2003. It works in all
other versions I have tried. Does anyone know how I can fix this ASAP!!!
 
Back
Top