Subform Subtotal to Main form linkage problems ????? help

D

devastator442

Hello all,

I have a form that has three subforms each with a subtotal. I have these
subtotals in the footer of each subform. I then have a field on the main
form called GrandTotal which sums these three subform subtotals.

It works fine unless one of the subforms has no record. Then the GrandTotal
field just displays nothing.

=[GeneralTransactionsSpendQRY2].[Form]![SubTotal]+[SoftwareTransactionsLicenseQRY].[Form]![SubTotal]+[SoftwareTransactionsMaintenanceQRY].[Form]![SubTotal]

is the value I have it set to.
Ideally, I would want the field to treat a lack of a record as 0. How can I
accomplish this? Thanks.
 
6

'69 Camaro

Hi.
Ideally, I would want the field to treat a lack of a record as 0. How can I
accomplish this?

Use the Nz( ) function. Try: (Watch out for word wrap, since this is all
one line.)

= Nz([GeneralTransactionsSpendQRY2].[Form]![SubTotal], 0) +
Nz([SoftwareTransactionsLicenseQRY].[Form]![SubTotal], 0) +
Nz([SoftwareTransactionsMaintenanceQRY].[Form]![SubTotal], 0)

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


devastator442 said:
Hello all,

I have a form that has three subforms each with a subtotal. I have these
subtotals in the footer of each subform. I then have a field on the main
form called GrandTotal which sums these three subform subtotals.

It works fine unless one of the subforms has no record. Then the GrandTotal
field just displays nothing.

=[GeneralTransactionsSpendQRY2].[Form]![SubTotal]+[SoftwareTransactionsLicenseQRY].[Form]![SubTotal]+[SoftwareTransactionsMaintenanceQRY].[Form]![SubTotal]

is the value I have it set to.
Ideally, I would want the field to treat a lack of a record as 0. How can I
accomplish this? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top