Subform/Mainform Calculation

ltiner

New member
Local time
Today, 15:38
Joined
Jun 13, 2002
Messages
9
In brief:

Main form containing a Subform

Text box on main form with the following control:
=[frmFC3Child].[Form]![txtSGallons]+[tbxfcojmovfc3-1]+[tbxfcojmovfc3-2]+[tbxfcojmovfc3-3]+[tbxfcojmovfc3-4]+[tbxfcojmovfc3-5]+[tbxfcojmovfc3-6]

One number comes from the sub form, all the others (6) come from the main form.

The problem is that the text box does not perform this calculation if there are no records in the sub form. (As soon as you enter a record in the sub form, it works properly.)

How do I get it to "fire" with no sub form records?
 
Try

=IIf(IsNull([frmFC3Child].[Form]![txtSGallons]), 0, [frmFC3Child].[Form]![txtSGallons]) +[tbxfcojmovfc3-1]+[tbxfcojmovfc3-2]+[tbxfcojmovfc3-3]+[tbxfcojmovfc3-4]+[tbxfcojmovfc3-5]+[tbxfcojmovfc3-6]

Chris
 

Users who are viewing this thread

Back
Top Bottom