MS Access XP: Create a sum field in Data Report.
I have developed a simple data report in my access application. I have a simple "Report Header" section with some titles and a "Body" section where I show fields coming from my recorset.
so far, so good.
Now I created a field inside "Report Footer" section, the field is a text box and its ControlSource is: "=Sum([one of my integer fields])"
but, when I open my report I get the error
Error 2589: Unvalid expression: "Sum([Distr.Cop])"
Why?
Re: MS Access XP: Create a sum field in Data Report.
Ok solved. I needed all yesterday and 2 hours this morning just to discover that I just needed to rename the [Distr.Cop] into DistrCop.
So:
Visual Basic uses square brakets for special named fields.
SQL uses square brakets for special named fields.
Access uses square brakets for special named fields.
ControlSource uses square brakets for special named fields.
ControlSource uses square brakets for special named fields when they are inside a formula.
ControlSource DOESN'T support special named fields when they are inside a formula with a SUM.
This is ridiculous.