Results 1 to 6 of 6
  1. #1
    MSommer is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2023
    Posts
    10

    Error for Transformed Row Source query on chart created automatically by Access

    I've created a database for users and split the database. I have a landing page or main form that auto opens when the database opens. In that form there are 4 charts based on simple queries. When I set the chart options Access automatically set the Transformed Row Source to:

    SELECT Format([Effective Date], "mmm 'yy"), FROM [All Pending Enrollments_CHART] GROUP BY Format([Effective Date], "mmm 'yy"), Year([Effective Date])*12 + Month([Effective Date])-1 ORDER BY Year([Effective Date])*12 + Month([Effective Date])-1

    Now when entering the database when the main form auto opens, users are presented with this error message:



    The Select statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.


    Odd thing is that it seems to only present this error in the split database not the backup database that is not split. The select statement looks fine to me. Maybe something related to the splitting of the database? Any ideas are appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    try putting all your 'formatting' fields in the base query. Then the where & orderby is just a simple field call: order By [SortFld]

    sometimes 'errors' on simple legal functions are actually a false error due to a bad REFERENCE in the VBE. Make sure your VBE references are good and none are MISSING.

    sometimes access wants legal 'date math' by using: DateAdd() & DateDiff()

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If that's the actual SQL, the comma before "FROM" would cause it to be illegal.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    MSommer is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2023
    Posts
    10

    Thank you

    Quote Originally Posted by ranman256 View Post
    try putting all your 'formatting' fields in the base query. Then the where & orderby is just a simple field call: order By [SortFld]

    sometimes 'errors' on simple legal functions are actually a false error due to a bad REFERENCE in the VBE. Make sure your VBE references are good and none are MISSING.

    sometimes access wants legal 'date math' by using: DateAdd() & DateDiff()

    Didn't think about using the DateAdd and DateDiff functions. I will try that! Thank you

  5. #5
    MSommer is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2023
    Posts
    10
    Funny thing is I didn't write it. Access created that based on the selections I made in the chart formatting. I will try removing the comma. Thanks!

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You must have amended it, even if inadvertently.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 04-14-2021, 08:49 AM
  2. Replies: 7
    Last Post: 09-19-2018, 09:26 AM
  3. Replies: 8
    Last Post: 09-24-2014, 05:36 PM
  4. Replies: 2
    Last Post: 10-12-2012, 03:46 PM
  5. Replies: 0
    Last Post: 11-30-2011, 02:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums