sum calcualtion from subform to main form

kabir_hussein

Registered User.
Local time
Today, 09:13
Joined
Oct 17, 2003
Messages
191
Hi i have a form and a subform within it.

the sum form has some invoice numbers which i would like to total up. However i would like to calculate it minus the total ordered. The total ordered is on the main form and the total value of invoice is on the sub form

here is the SQL i am using but it dont seem to work.

=[Total Cost]-Sum([invoicefrm1].Form![Value Of Invocie])

however i only get an error mesage. if i do the calcualtion using a text box on the sub form it works but not on the main form. any suggestion where i could be going wrong

Regards

kabir
 
You have to use the full forms reference, the Code builder for the textbox will enable you to reference the forms/fields correctly
 
do you mean something like this

=[Forms]![invoicefrm]![Total Cost]-Sum([invoicefrm1].[Form]![Value Of Invocie])

as i have tried this it does not work-i get an #Error msg

here is the code that works from the sub form

=[Forms]![invoicefrm]![Total Cost]-Sum([Value Of Invocie])

however i want to try do the same except from the main form.
 
=Forms!MainFormName!subFormControlName.Form!ControlName


where subFomControlName is the name of the subform as it appears on the main form property sheet
 

Users who are viewing this thread

Back
Top Bottom