sphere_monk
Registered User.
- Local time
- Today, 17:53
- Joined
- Nov 18, 2002
- Messages
- 62
Hi everyone,
I've got a grand total field on a parent form that adds the value of two summary fields that are located on subforms of the parent, each one on a different subform. These subforms are looking up transactions from different tables. One subform DOES allow edits, additions and deletions (EAD's) whereas the other does NOT allow these. They are both "Continuous Forms" type forms.
The parent grand total field is using the following for a Control Source: [frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]+[frmProjectBudgetTrans].[Form]![txtTotal]
The trouble I'm having is that if the subform that does NOT allow EAD's does not find any records in the table, then the parent form's grand total shows "#Error". If the situation is reversed, with a record found in the subform that does NOT allow EAD's but with no record found in the form that DOES allow EAD's, then the parent's total is blank rather than showing an error.
Does anyone know of a way I can force the parent form's grand total to display "0" instead of "#Error" if the subform that does NOT allow EAD's shows no records?
I've tried changing the Control Source to IIf(IsNull([frmProjectBudgetPOsubfrm].[Form]![txtPOTotal])=True Or [frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]="",(0+[frmProjectBudgetTrans].[Form]![txtTotal]),[frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]+[frmProjectBudgetTrans].[Form]![txtTotal]), but this does not help.
Thanks!
Dan
I've got a grand total field on a parent form that adds the value of two summary fields that are located on subforms of the parent, each one on a different subform. These subforms are looking up transactions from different tables. One subform DOES allow edits, additions and deletions (EAD's) whereas the other does NOT allow these. They are both "Continuous Forms" type forms.
The parent grand total field is using the following for a Control Source: [frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]+[frmProjectBudgetTrans].[Form]![txtTotal]
The trouble I'm having is that if the subform that does NOT allow EAD's does not find any records in the table, then the parent form's grand total shows "#Error". If the situation is reversed, with a record found in the subform that does NOT allow EAD's but with no record found in the form that DOES allow EAD's, then the parent's total is blank rather than showing an error.
Does anyone know of a way I can force the parent form's grand total to display "0" instead of "#Error" if the subform that does NOT allow EAD's shows no records?
I've tried changing the Control Source to IIf(IsNull([frmProjectBudgetPOsubfrm].[Form]![txtPOTotal])=True Or [frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]="",(0+[frmProjectBudgetTrans].[Form]![txtTotal]),[frmProjectBudgetPOsubfrm].[Form]![txtPOTotal]+[frmProjectBudgetTrans].[Form]![txtTotal]), but this does not help.
Thanks!
Dan