subform total to mainform

J

John

I have a mainform with a tabcontrol and on a tab there is a subform on
it. The subform has a total txtbox on it that totals the quantity of
items in the subform. The txtbox on the main form then shows the
quantity. The controlsource on the mainform has
=[zPurchaseOrderItems].[Form]![txtTotalQuantity] that does show the
quantity. But if the status is Void, there are no items showing in
the subform and I get #Error for the quantity. Going to one of those
voided records gives expression error. What is the work around for
it?
Thanks.
.... John
 
J

John

John said:
I have a mainform with a tabcontrol and on a tab there is a subform on
it.  The subform has a total txtbox on it that totals the quantity of
items in the subform.  The txtbox on the main form then shows the
quantity.  The controlsource on the mainform has
=[zPurchaseOrderItems].[Form]![txtTotalQuantity] that does show the
quantity.  But if the status is Void, there are no items showing in
the subform and I get #Error for the quantity.  Going to one of those
voided records gives expression error.  What is the work around for
it?

The main form text box can use an expression like:

=IIf(IsError([zPurchaseOrderItems].[Form]![txtTotalQuantity],
0, [zPurchaseOrderItems].[Form]![txtTotalQuantity])


When I enter this into the txtbox control source I get a notice that
the expression has a function containing the wrong number of
arguments.
.... John
 
J

John

John said:
I have a mainform with a tabcontrol and on a tab there is a subform on
it.  The subform has a total txtbox on it that totals the quantity of
items in the subform.  The txtbox on the main form then shows the
quantity.  The controlsource on the mainform has
=[zPurchaseOrderItems].[Form]![txtTotalQuantity] that does show the
quantity.  But if the status is Void, there are no items showing in
the subform and I get #Error for the quantity.  Going to one of those
voided records gives expression error.  What is the work around for
it?
The main form text box can use an expression like:
=IIf(IsError([zPurchaseOrderItems].[Form]![txtTotalQuantity],
0, [zPurchaseOrderItems].[Form]![txtTotalQuantity])

When I enter this into the txtbox control source I get a notice that
the expression has a function containing the wrong number of
arguments.
... John- Hide quoted text -

- Show quoted text -


Mr Barton, I think I got it figured out. Thanks for the info.
... John
 

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