If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Forms and suforms
I have an Orders main form with a subform similar to the Northwind orders
form but bigger. Both the main form and subform are based on multi-table queries. The subform default view is Datasheet and displays 12 controls. 3 controls are based on calculated fields in the underlying query. A control displaying the sum of each of these 3 controls is displayed in the footer of the subform. I wish to display this information in 3 controls on the main form as the subform default view is Datasheet and the controls in the footer are not displayed on the subform. The problem I have is I get "#Name?" error in the controls on the main form where I want to display the totals calculated in the controls in the footer of the subform. I've think I have done things according to the Acces help file "About calculating totals in a subform and displaying it on a form", but I can't get it to work. Any suggestions gratefully accepted. Thanks in advance. -- paulu |
#2
|
|||
|
|||
Forms and suforms
Paulu,
As there are a couple of approaches to doing this, could you supply some more details of how exactly you are attempting to do it? The #NAME error can commonly result from small errors in the syntax of how you are referring to your controls, especially when you are referencing things in a subform or from a subform to a parent form. -- Gary Miller Sisters, OR "paulu" wrote in message ... I have an Orders main form with a subform similar to the Northwind orders form but bigger. Both the main form and subform are based on multi-table queries. The subform default view is Datasheet and displays 12 controls. 3 controls are based on calculated fields in the underlying query. A control displaying the sum of each of these 3 controls is displayed in the footer of the subform. I wish to display this information in 3 controls on the main form as the subform default view is Datasheet and the controls in the footer are not displayed on the subform. The problem I have is I get "#Name?" error in the controls on the main form where I want to display the totals calculated in the controls in the footer of the subform. I've think I have done things according to the Acces help file "About calculating totals in a subform and displaying it on a form", but I can't get it to work. Any suggestions gratefully accepted. Thanks in advance. -- paulu |
#3
|
|||
|
|||
Forms and suforms
Gary,
The query which is the record source for the subform has 3 calculated fields one of which I put in below. ExtendedPrice: ([UnitSellPrice]+[UnitCostFIS])*[ShippedQuantity]*(1-[Discount]) The other 2 are similar. The footer of the subform has a control with the name; TotalProductSell and the control source; =Sum([ExtendedPrice]) The main form has a control which has a control with the name; InvoiceSubtotal and control source; =[frmOrderSubform].[Form]![TotalProductSell] And I continue to get #Name? apearing in my control. If you can help that would be great. Cheers -- paulu "Gary Miller" wrote: Paulu, As there are a couple of approaches to doing this, could you supply some more details of how exactly you are attempting to do it? The #NAME error can commonly result from small errors in the syntax of how you are referring to your controls, especially when you are referencing things in a subform or from a subform to a parent form. -- Gary Miller Sisters, OR "paulu" wrote in message ... I have an Orders main form with a subform similar to the Northwind orders form but bigger. Both the main form and subform are based on multi-table queries. The subform default view is Datasheet and displays 12 controls. 3 controls are based on calculated fields in the underlying query. A control displaying the sum of each of these 3 controls is displayed in the footer of the subform. I wish to display this information in 3 controls on the main form as the subform default view is Datasheet and the controls in the footer are not displayed on the subform. The problem I have is I get "#Name?" error in the controls on the main form where I want to display the totals calculated in the controls in the footer of the subform. I've think I have done things according to the Acces help file "About calculating totals in a subform and displaying it on a form", but I can't get it to work. Any suggestions gratefully accepted. Thanks in advance. -- paulu |
#4
|
|||
|
|||
Forms and suforms
Palau,
The name of your subform is frmOrderSubform right? What is the name of your subform control that displays the subform? That is the name that you need to use in the subform reference, not the name of the subform itself. =[NameOfSubFormControl].Form!TotalProductSell -- Gary Miller Sisters, OR The main form has a control which has a control with the name; InvoiceSubtotal and control source; =[frmOrderSubform].[Form]![TotalProductSell] And I continue to get #Name? apearing in my control. |
#5
|
|||
|
|||
Forms and suforms
Thanks Gary,
That was my problem. The name of the control that displays the subform is different to the name of the form. It works fine now. Thanks again, Cheers, -- paulu "Gary Miller" wrote: Palau, The name of your subform is frmOrderSubform right? What is the name of your subform control that displays the subform? That is the name that you need to use in the subform reference, not the name of the subform itself. =[NameOfSubFormControl].Form!TotalProductSell -- Gary Miller Sisters, OR The main form has a control which has a control with the name; InvoiceSubtotal and control source; =[frmOrderSubform].[Form]![TotalProductSell] And I continue to get #Name? apearing in my control. |
#6
|
|||
|
|||
Forms and suforms
Glad to have been of some help.
Good luck with your project. -- Gary Miller Sisters, OR |
Thread Tools | |
Display Modes | |
|
|