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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#error for Sum on calculated subform detail row total



 
 
Thread Tools Display Modes
  #1  
Old April 18th, 2007, 01:36 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
[email protected]
external usenet poster
 
Posts: 7
Default #error for Sum on calculated subform detail row total

Hi, I have a subform with a number of rows with combo box lookups.
Hidden fields of the combo box lookups are used to perform a row
calculation, for example:

RowTotal text box control source is set to: [Quantity]*[Type].[Column]
(2)

The row total is calculated perfectly. But when i try and sum this
RowTotal i get an error, i have read Sum() can only be performed on
fields not calculated controls as i am doing, but is there any way to
achieve what i want?

I'm guessing the only option is to do a total query with DLookup but i
was worried about speed and would like to have offloaded this to the
machine rather than doing an additonal SQL call.

Any ideas?

Thanks,

Chris

  #2  
Old April 18th, 2007, 02:19 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
SusanV
external usenet poster
 
Posts: 399
Default #error for Sum on calculated subform detail row total

You can use the on update event of the combobox to populate a variable with
that value, do your calculations then populate your totals box with the
result, something like:

dim i as integer

i = me.combobox.column(2)

me.totaltextbox = me.quantity * i


--
hth,
SusanV


wrote in message
oups.com...
Hi, I have a subform with a number of rows with combo box lookups.
Hidden fields of the combo box lookups are used to perform a row
calculation, for example:

RowTotal text box control source is set to: [Quantity]*[Type].[Column]
(2)

The row total is calculated perfectly. But when i try and sum this
RowTotal i get an error, i have read Sum() can only be performed on
fields not calculated controls as i am doing, but is there any way to
achieve what i want?

I'm guessing the only option is to do a total query with DLookup but i
was worried about speed and would like to have offloaded this to the
machine rather than doing an additonal SQL call.

Any ideas?

Thanks,

Chris



  #3  
Old April 19th, 2007, 01:48 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
[email protected]
external usenet poster
 
Posts: 7
Default #error for Sum on calculated subform detail row total

You can use the on update event of the combobox to populate a variable with
that value, do your calculations then populate your totals box with the
result, something like:

dim i as integer

i = me.combobox.column(2)

me.totaltextbox = me.quantity * i


Hi, are you 100% sure about that, because would it not be that for
each row the totalbox will be overwritten? I want to sum for all
lines, which would be different than the above?

Thanks again,

Chris

  #4  
Old April 19th, 2007, 01:56 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding
SusanV
external usenet poster
 
Posts: 399
Default #error for Sum on calculated subform detail row total

Is this a continuous form? If so, then I would not do this with live data
(maybe try it on a backup but then again ALL dev should be done on a backup)
--
hth,
SusanV


wrote in message
oups.com...
You can use the on update event of the combobox to populate a variable
with
that value, do your calculations then populate your totals box with the
result, something like:

dim i as integer

i = me.combobox.column(2)

me.totaltextbox = me.quantity * i


Hi, are you 100% sure about that, because would it not be that for
each row the totalbox will be overwritten? I want to sum for all
lines, which would be different than the above?

Thanks again,

Chris



 




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 04:40 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.