DSum

Gurn

Registered User.
Local time
Today, 08:02
Joined
May 6, 2004
Messages
12
I am trying to get a running sum of weight for different product numbers using the DSum function in a text box control source... Here is the function =DSum([txtTotalWeight],"rptSchedIngredients","[F_IngCode] = " & [F_IngCode]), but when I run it the result is #ERROR#... Any Ideas???
Thanks,
Gurn
 
Durn,

Code:
=DSum("[txtTotalWeight]","rptSchedIngredients","[F_IngCode] = " & [F_IngCode])

But, I don't think that your table's column is really --> [txtTotalWeight]

Wayne
 
Thanks for the reply but it's still not working, is there another function I can use other than this =DSum ("[TotalWeight]", "qryschedIngredients", "[F_IngCode = " & [F_IngCode])
FYI: I have this in a txt box on a report and I am trying to use the DSum as the query is running and generating the report.. Is this the wrong way to approach it??? Also this is the first time I have ever tried to use DSum so any help would be appreciated...
Thanks,
Gurn
 
Gurn,

You didn't say what your error is:

You need a closing "]" on F_lngCode
If F_lngCode is a number, you're OK, otherwise need punctuation
Also, function will return Null value if Criteria not met.

Code:
DSum("[TotalWeight]", "qryschedIngredients", "[F_IngCode = " & [F_IngCode])

Wayne
 
Wayne,
That's my fault, I just didn't type it in properly, but it is correct on the report... It's not given me an error, but when I run it "#Error" is the only thing that comes up... Like I said before I'm not sure if I am using the DSum function in the proper place... I couldn't figure out how to use it in a query...
Any advice???
Gurn
 

Users who are viewing this thread

Back
Top Bottom