A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subtotal in form Died With Combo Box



 
 
Thread Tools Display Modes
  #1  
Old October 8th, 2007, 11:14 PM posted to microsoft.public.access.tablesdbdesign
OnTheJobLearning
external usenet poster
 
Posts: 17
Default 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  
Old October 10th, 2007, 08:31 AM posted to microsoft.public.access.tablesdbdesign
boblarson
external usenet poster
 
Posts: 886
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.