How to fix Errors using DSum function

martinr

Registered User.
Local time
Today, 09:20
Joined
Nov 16, 2011
Messages
74
I am trying to use the DSum function on a form, however if I try to use it with a fieldname that begins with a numeric character (eg; “2013Sales” ) it throws an error.
If I change the fieldname (eg “Sales”) the error doesn’t occur, however the original field name works fine in other queries/expressions etc;

Does the syntax of the DSum expression need to change because of the character types in the fieldname or is using numeric characters in a field name always going to cause problems???
 
Where are you using DSum()? In VBA code on a form? In the control source of a control on a form?

What is the exact expression you typed?

It throws an error? Which error?

#NarrowItDown
 
Any fieldname that starts with a number must be enclosed in square brackets.

It is good reason to avoid such names.
 
I tried the square brackets around the fieldname and it worked!
If that is documented somewhere I sure had missed it...
Thanks for that...
 

Users who are viewing this thread

Back
Top Bottom