Formula returning #Error (1 Viewer)

Gavx

Registered User.
Local time
Today, 17:06
Joined
Mar 8, 2014
Messages
151
I have a form containing a subform.
The subform contains checkboxes and corresponding amounts and bank account numbers.
In the footer section of the subform is a DSUM formula saying add up all amounts of a particular account whose checkbox is true :=DSum("[Amount]","tblImport","[Import]=True AND [AccountNo] =[Forms]![fmImport]![txtAccountNo]").

The main form has a text box that reports the total of the sub form. Problem I have is when nothing has been checked on the subform the reported total of the subform is #Error.

The formula on the main form is =[sbfImportSelect].[Form]![txtSubTot]

Is an Iif formula the solution?. Or Nz? Or is there another way?

Thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:06
Joined
May 7, 2009
Messages
19,246
add Nz() function:

Nz(DSum("[Amount]","tblImport","[Import]=True AND [AccountNo] =[Forms]![fmImport]![txtAccountNo]"), 0)
 

Users who are viewing this thread

Top Bottom