Sum a field that refers to a combobox column

PeterOC

Registered User.
Local time
Tomorrow, 01:14
Joined
Nov 22, 2007
Messages
80
Hello,


I have a field in a form called 'PricePerKg'
Control Source: = [StockCode].[Column](3)

What I'd like to do is get a total of this field in the form footer.

I put in sum([StockCode].[Column](3)) but I just get error.

What's the correct syntax to get this to sum?

Thanks,

Peter
 
try =nz(sum([StockCode].[Column](3)),0) am not sure if it works because I don't know how your form is build, but still try it, then it might work.
 
Thanks khodr but I'm still getting the errors in the form footer field.
The field to be summed is double data type.
I've put the nz in the detail line and in the total field in the form footer.
I've also tried
Cdbl(nz(Sum([StockCode].[Column](3)),0))
Any other ideas?
 
Js for me I do this normally via the query itself but I need to understand the table structure can post an image here about your table structure
 
Put a hidden textbox in the detail section with this as a control source:
nz(sum([StockCode].[Column](3)),0)

Then in the footer of the form, reference that textbox by putting this in the control source:
=[Formname].[Form]![yourtextbox]
 

Users who are viewing this thread

Back
Top Bottom