Calculating subform on a form

rdeanh

New member
Local time
Today, 04:08
Joined
Aug 10, 2002
Messages
8
Please help. I am going crazy. All I want to do is make my form(Orders) display the order total from the subform (Order Details) that is linked to it. I can get the subform to show the total but not the form. The subform control has the following control source: =nz(Sum([ExtCtnQty]*[QTY]*([ExtendedPrice]-([ExtendedPrice]*[Discount])))). Its name is OrdTotal. I have tried making the control source for the form as follows: =(Forms![Order Details]![OrdTotal]) but every time I go into the main form again I get a #Name appearing and when I go back into the control, it now reads =(Forms![Order Details]!OrdTotal). I cannot get the brackets to stay on the OrdTotal. I have also tried to use DLookUp. I have even tried making the OrdTotal calculation an expression in the underlying query and referencing it that way. I have tried moving the OrdTotal to the details, page footer, and form footer. I have tried everything. Can someone please provide some insight?

Thanks,

RdeanH
 
Are you comfortable with code? If so, in your subform's Current Event you can insert something like this:

Forms![Orders]![YourControlNameOnOrders] = Me.OrdTotal.Value

The same line can go in the After Update event of controls that influence the order total, assuming those controls are located on the subform.

Regards,
Tim
 
=[Forms]![Orders]![OrderDetails]![OrdTotal]
You have to reference the main and subform
 

Users who are viewing this thread

Back
Top Bottom