DSum Countrol Source Help

E

e.winterod

I am a relatively new Access Database developer, I am becoming more familiar
with the tool/calculations but I am having trouble figuring out why I get the
#Error when using the DSum Calcultion.

I have an unbound text box on a Form, backed by a query.
The goal is to count the [# of Pages Published] for each [Action], example
"New".

The calculation I am entering is:

=DSum("[# of Pages After]","qry_Form_DocDashbaord","[Action]=""New""")

I have gone into my table to verify:

1. [# of Pages After] is a Number field.
2. [Action] is a Text Field.
3. There are no null values.

I have also tried it with qry_Form_DocDashboard is in brackets, and still
get the same results.

Please help, I have searched the internet at other problems/answers and cant
figure out what I am doing wrong.

Thanks!
 
L

Lynn Trapp

Try this instead

=DSum("[# of Pages After]","qry_Form_DocDashbaord","[Action]= " & "New")
 
E

e.winterod

I tried the expressions in both replies

=DSum("[# of Pages After]","qry_Form_DocDashboard","[Action]=""New""")

And

=DSum("[# of Pages After]","qry_Form_DocDashbaord","[Action]= " & "New")

I continue to get the #Error message :(
 
E

e.winterod

I was able to ask my supervisor for help and he gave me the following as an
alternative:

=Sum(IIf([qry_Form_DocDashboard]![Action]="Delete",[qry_Form_DocDashboard]![# Pages After]))

This works, but I would still like troubleshooting on why the DSum doesnt
work. Thanks!!
 
E

e.winterod

I verified that the query doesnt have any parameters set.

Thank you for all of your help !!

Ellen
 
J

JimfromIndy

Ellen:

Beats me, I'm afraid.  If you care to post the SQL of the query (and any
queries which it draws upon) it might give us a clue, but at first sight I
can't see why your original expression didn't work.

Ken Sheridan
Stafford, England

e.winterod said:
I verified that the query doesnt have any parameters set.
Thank you for all of your help !!
I can't see any obvious error in the original expression once the spelling is
corrected.  Does the query include any parameters?  That might explain it.
[quoted text clipped - 10 lines]
Ken Sheridan
Stafford, England

Try the following:

=DSum("[# of Pages After]","qry_Form_DocDashbaord","[Action]='New'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top