• Left function problem in Access 2013

    Author
    Topic
    #498020

    Having just updated to 2013 I am seeing the expected errors with macros in Excel needing declaration including the PtrSafe but in Access I am seeing a problem wherever the Left() type function has been included. (also the Right and Mid)
    The error message says:
    There was an error compiling this function
    the Visual Basic module contains a syntax error.
    check the code, then recompile it
    OK

    when I remove the Left/Right/Mid function then it works fine.

    any suggestions would be most appreciated.
    thanks
    Alan

    Viewing 2 reply threads
    Author
    Replies
    • #1483265

      check references to see if any are missing.

    • #1483266

      Can you post some of your code with the offending functions?

      cheers, Paul

      • #1483275

        The LEFT function is a red herring!
        I have a module in the database that declares a function completely unrelated to the Left/Right/Mid and I had overlooked it when including PtrSafe in the ‘Declare Function’ script.

        As soon as I changed it to ‘Declare PtrSafe Function’ then the code and queries run fine once more.

        thanks PATT, appreciate the quick jump in on this.
        Sounds like I gotta bit of catching up to do with other macros and databases now.

    • #1483272

      The code is actually in the query field in this particular instance and is:
      “Left([sort_code],2) & Mid([sort_code],4,2) & Right([sort_code],2) AS S_C,”

      all pretty basic run of the mill, but the left/right/mid causes the compile error

    Viewing 2 reply threads
    Reply To: Left function problem in Access 2013

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: