subform total to mainform

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
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
 
Back
Top