I have a form and subform each based on its own query. The results of the two queries (e.g. "Total A" and "Total B"must be added together in control "TotalC". I've created a macro that calculates the total with "SetValue","[TotalC]",argument"[TotalA]+[TotalB]".
This works fine when the both the form and subform returns actual values, but obviously gives me a #Error message when there are no underlying records entered for either the subform or main form.
My attempts at conditional expressions in the macro to solve this (e.g. If "IsNull([TotalA]) then SetValue ....0 .." and If "[TotalA]=" "" then...bla..bla..) doesn't work, presumably because even to evaluate a null value, there must be at least a record to evaluate!
I know diddly squat about VB and need to use some sort of conditional expression for a macro to return a $0.00 value if there are no records to base the Sum calculation on.
Can one use "Nz" in the control source line of a control's property box to force a $0.00 value. If so, how(I've tried Access Help and failed), and if not...what now?
This works fine when the both the form and subform returns actual values, but obviously gives me a #Error message when there are no underlying records entered for either the subform or main form.
My attempts at conditional expressions in the macro to solve this (e.g. If "IsNull([TotalA]) then SetValue ....0 .." and If "[TotalA]=" "" then...bla..bla..) doesn't work, presumably because even to evaluate a null value, there must be at least a record to evaluate!
I know diddly squat about VB and need to use some sort of conditional expression for a macro to return a $0.00 value if there are no records to base the Sum calculation on.
Can one use "Nz" in the control source line of a control's property box to force a $0.00 value. If so, how(I've tried Access Help and failed), and if not...what now?