CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Merate-North Italy
    Posts
    230

    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?
    ++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
    God does not play dice with the universe.(A.Einstein)

  2. #2
    Join Date
    Oct 2003
    Location
    Merate-North Italy
    Posts
    230

    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.
    ++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
    God does not play dice with the universe.(A.Einstein)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured