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
|
|||
|
|||
Subtotal in form Died With Combo Box
So, I cannot do a Sum function when one of the control sources is an
expression (to pull a number from a table?) Thanks. You no longer have a Unit Cost field in the form if you have set the Control Source of a Unit Cost control to this expression: =[Wafer TypeA].Column(1) So this expression is not valid any more because Sum cannot see a control named Unit Cost, it can only see a field named Unit Cost: =Sum([Quantity]*[Unit Cost]) -- Ken Snell MS ACCESS MVP "OnTheJobLearning" wrote in message ... The Subtotal field in the main form is: =[Approvals Subform]![Total Approved] The Total Approved field in the subform is: =Sum([Quantity]*[Unit Cost]) The Unit Cost field is: (Based off Wafer TypeA combo box choice) =[Wafer TypeA].Column(1) "Ken Snell (MVP)" wrote: Assuming that you're using the Sum function to calculate the subtotal, you must use only field names in the Sum expression -- you cannot use the value from a control. Post the expression that you're using to calculate the subtotal. -- Ken Snell MS ACCESS MVP "OnTheJobLearning" wrote in message ... I have a calculated subtotal in a subform that is displayed in the main form. Worked well. Until, I created a combo box to select the product and set up the Unit Price field to auto fill from the product choice. The line total calculation in the subform after the unit price works yet. I noticed, however, that my calculated subtotal in the main form stopped working. Is this because the unit price involved in the calculation of the line total is tied to the product choice in the combo box? thanks! |
#2
|
|||
|
|||
Subtotal in form Died With Combo Box
You CAN use the Sum, but you have to pass it the entire full calculation
instead of controls that have the calculations in them (as Ken Snell) noted. -- Bob Larson Access World Forums Super Moderator Utter Access VIP ____________________________________ Access 2000, 2003, 2007, SQL Server 2000, Crystal Reports 10/XI, VB6 WinXP, Vista "OnTheJobLearning" wrote: So, I cannot do a Sum function when one of the control sources is an expression (to pull a number from a table?) Thanks. You no longer have a Unit Cost field in the form if you have set the Control Source of a Unit Cost control to this expression: =[Wafer TypeA].Column(1) So this expression is not valid any more because Sum cannot see a control named Unit Cost, it can only see a field named Unit Cost: =Sum([Quantity]*[Unit Cost]) -- Ken Snell MS ACCESS MVP "OnTheJobLearning" wrote in message ... The Subtotal field in the main form is: =[Approvals Subform]![Total Approved] The Total Approved field in the subform is: =Sum([Quantity]*[Unit Cost]) The Unit Cost field is: (Based off Wafer TypeA combo box choice) =[Wafer TypeA].Column(1) "Ken Snell (MVP)" wrote: Assuming that you're using the Sum function to calculate the subtotal, you must use only field names in the Sum expression -- you cannot use the value from a control. Post the expression that you're using to calculate the subtotal. -- Ken Snell MS ACCESS MVP "OnTheJobLearning" wrote in message ... I have a calculated subtotal in a subform that is displayed in the main form. Worked well. Until, I created a combo box to select the product and set up the Unit Price field to auto fill from the product choice. The line total calculation in the subform after the unit price works yet. I noticed, however, that my calculated subtotal in the main form stopped working. Is this because the unit price involved in the calculation of the line total is tied to the product choice in the combo box? thanks! |
Thread Tools | |
Display Modes | |
|
|