Discussion Locked

eliminate the error#

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am creating a form (invoice) that has three subforms. In the form there are three subtotal controls. One for each subform. Each subform lists the products or services provided and their cost.

The form works fine when there is items listed ineach subform. If there are no records in a subform I get the error# in the subtotal controls and in the Totals control. There has to be a setting I'm missing that will allow a 0 to appear if there are no records to calculate.

I've read a brief description on Nz but not sure how that works.

Does anyone have a suggestion.

Thanks

5 replies

by johnnyextreme

Try performing the subtotal in a control on the subform, then refering to the subform control in the Control Source of a control on the main form. I did this using a control on the subform that is a text box with the Control Source like
=Sum([Qty]*[Price]). The text box control on the main form has a Control Source of =[sbfInvoiceDetails].[Form]![txtSubTotal]. I do not have the problem with #Error displayed on the main form, or the subform.

by vchd_it

I have setup subtotal in each subform =sum{field} and setup a subtotal in the form for each subform subtotal =[SF(field)].[Form]![field]. It is in the latter subtotal that I am getting the #error.

by sue t

add an IF statement to your formula that tells it to enter a zero if the cell in the subform is blank.

by vchd_it

How do you set up the formula to indicate a null record IIF([field]="",0,[= [SF(field)].[Form]!{field]???

This discussion is closed to new replies.