Issues getting DSum to work.

acarterczyz

Registered User.
Local time
Today, 16:07
Joined
Apr 11, 2013
Messages
68
Hey guys,

I looked through all the previous posts about this, but it seems that I can't get my formula to work. I keep getting the dreaded #Error message on my form.

What I'm trying to do:
I'm trying to get the count of all lines that have 'SG' in the Assgn Type column from the Details table IF that line has it's Primary column matching the Product Code on my form. Sounds simple enough, right? :p

Here is my formula:
=DSum("Asgn Type","Detail","Asgn Type='SG'" & "AND [Primary] = [Products]![Product Code]")

I've tried about every variation I could find for this formula.

Any help would be MUCH appreciated!
 
Several issues. Try

=DSum("[Asgn Type]","Detail","[Asgn Type]='SG' AND [Primary] = " & [Products]![Product Code])

Are you sure you want to sum [Asgn Type]?
 
I'm trying to get the count of how many lines SG shows up in with the Primary on that line matching the Product Code.

And that formula gives me the #Name? error now. I guess thats better than the #Error? lol
 
Working now! Thanks pbaldy!

Formula is: =DCount("[Asgn Type]","Detail","[Asgn Type]='SG'" & " AND [Primary] = [Products]![Product Code]")
 
Glad you got it sorted out. Error was likely due to trying to sum a text field.
 

Users who are viewing this thread

Back
Top Bottom