The information in this article applies to:
SYMPTOMSThe Order Amount field in the Orders table is incorrectly set to zero. CAUSE
The Orders.Write Order Amount macro writes the order subtotal,
calculated in the subform footer, to the Order Amount field in the
Orders table before the order subtotal has finished calculating.
RESOLUTIONThe Order Subtotal field in the subform footer cannot be relied on to calculate the correct order subtotal, since it is being calculated independently of other events occurring on the form. Instead, the value should be calculated using the DSum() aggregate function in the Orders.Write Order Amount macro. This result can be written to the Order Amount field in the Orders table. MORE INFORMATIONThis change has already been made to the sample database NWIND.MDB that ships with Microsoft Access version 1.1. Following the "Steps to Reproduce Behavior" section is a description of changes that must be made to version 1.0 of the sample database NWIND.MDB to correct this problem. There are additional suggestions to optimize the Orders form for both versions 1.0 and 1.1. Steps to Reproduce Behavior
Using DSum() Function to Correctly Calculate Order SubtotalThe following steps describe how to change the Orders form in Microsoft Access version 1.0 to implement the DSum() function:NOTE: The sample database ORDENTRY.MDB supplied with Microsoft Access uses the same technique to calculate the order subtotal. Please see the FrmOrders.Recalc macro in ORDENTRY.MDB for more information.
Because the Orders Subtotal field in the Order Subform footer is no longer necessary, use the following steps remove it and increase your database performance:
Additional query words: bringing totals from sub to main
Keywords : kbusage FmsSubf |
Last Reviewed: March 25, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |