Don't use [] for literal text, use apostrophe.
= DSum("[sales]", "[Sales_Demo]", "[Product Name] = 'orange'")
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
J7 advised against the [] but then left them in - - I think that was a typo
first sanity check this: = DSum("sales", "Sales_Demo")
once that works, then add in your criteria - what is displayed looks correct off the cuff: = DSum("sales", "Sales_Demo", "[Product Name] = 'orange'")
Then why did you leave [] around [Product Name] and not Sales or Sales_Demo?
No typo. The [] are used around field and object names. In fact, they are required if names have spaces or special characters/punctuation (underscore is exception). There is a space in [Product Name]. Although not required for Sales and Sales_Demo, doesn't hurt.
I said don't use the [] with literal text.
The word orange is literal text, not a name - it is a filter parameter.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.