Results 1 to 10 of 10
  1. #1
    mithrush is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2016
    Posts
    5

    Undefined function "format" in expression

    I am trying to run the following query MonthTxt: Format([monthnum]) which should change the number into text.

    However when it runs I get an error Undefined function "format" in expression.

    I have been into the trust centre area and amended the references but it still hasn't worked.

    This started when I updated the database from 2003 to 2007.



    Anybody any ideas?

    Thanks

  2. #2
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    One idea - if you still have Access 2003 on the same system you may need to update reference in your database from Microsoft Office 11 Library to Microsoft Office 12 Library. It won't show as missing or broken but still may cause problems.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    That error is normally associated with a reference problem. I know you said you checked them but perhaps this has more info:

    http://www.accessmvp.com/djsteele/Ac...nceErrors.html

    Also, have you tried including the second argument for the function, the desired format? Or using CStr() if all you're doing is making a number a string.

    Welcome to the site by the way. I deleted your duplicate thread; there is no need to post the same question twice. The people who answer questions check all the forums.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    mithrush is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2016
    Posts
    5
    I tried those options but it still didn't work. if I resolve the first error I just keep getting more as the query runs about different expressions.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Format function works without parameter for second argument.

    Could post full SQL statement of attempted query. Although that probably won't be helpful since the query used to work.

    Have you tried db on another computer running 2007?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    mithrush is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2016
    Posts
    5
    The query works within 2003 but I am trying to test all the macros, queries etc as we are in the process of moving to 2007. I don't want to convert all computers to 2007 until I am sure all everything works.

  7. #7
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Could you show screenshot of references screen on that pc with 2007 where it's not working?

  8. #8
    mithrush is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2016
    Posts
    5
    I have read about references being the problem so I went in and there was one MISSING. utility. mda which I then un-ticked. this let me run the query without the error message until it got so far and then the error message appears again and then I go back into references this reference is ticked again.

    Cant really get a screenshot of it

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    So it is a reference problem. That sounds like somebody's custom functions. Is the file where it's expected to be? The path should show in the references screen.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    I'm quite convinced it is problem with reference being left from previous version of access and not showing as missing or broken but still "invalid" somehow. So update references to current access version should help.
    Or there's an object somewhere in db named "Format", that could be anything from stupid label to table. Just a thought.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-14-2015, 09:48 AM
  2. Replies: 5
    Last Post: 05-28-2015, 03:24 PM
  3. Replies: 8
    Last Post: 03-05-2013, 01:20 PM
  4. Undefined Function "Left" in Expression
    By krueck in forum Access
    Replies: 4
    Last Post: 09-30-2011, 10:50 AM
  5. Replies: 8
    Last Post: 08-05-2011, 02:55 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