Dsum in Control source 'Invalid syntax'??

  • Thread starter Pieter Vanfleteren
  • Start date
P

Pieter Vanfleteren

Hey all,

I've got a strange error. I think I am doing it wright and I tried already a
lot of things.

I wont to get the sum of my prices in my report where the option is 1. My
report is made of a query "query_report_quotation" and the "cost_price" and
"option" field are in the query.

In the controle Source of a text box I put =DSum("[cost_price]",
"query_report_quotation","[option]=1")
Access gives me the following error:
'The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid character or
comma, or you entered text without surrounding it in quotation marks.'

but when I try the expression in the Immediate window it works:
?DSum("[cost_price]", "query_report_quotation","[option]=1")
1712,4

Any suggestions??
Thanks a lot
Pieter
 
D

Duane Hookom

Try not using DSum. Replace it with:
=Abs(Sum([cost_price] * [option]=1))

Make sure the name of the control isn't a field name.
 

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

Dsum in report header problem 6
invalid vertical bar 2
Syntax error in Dsum 5
DSUM in Group Footer 6
Header problem (2) 1
DSUM Report 3
DSUM Syntax Error 1
dsum with multiple criteria and decimals 0

Top