Results 1 to 4 of 4
  1. #1
    gameemaster is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    23

    Format Function Not Working

    This function has always worked in the past, i must made a change some where and now it wont work (prevents my append and update queries). I just removed the functions and set-up the query using TOP values. But any ideas why this fuctions just quick working, what if I use Int([Date])?



    DT: Format([Date],"mm/dd")
    Between DateAdd("d",-21,Date()) And Date()

    It's build into a lot of my charts and queries and would be a huge pain to re-move all. I attached a picture of the error. I'm receiving. Never had this before, and I've had my dates formatted that way to save space for a long time. oopps what did i do?Click image for larger version. 

Name:	Undefined_Function_Format_Access_Err0r.JPG 
Views:	16 
Size:	65.0 KB 
ID:	28628

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I did a test and cannot replicate issue. Format function works just fine.

    Try Compact & Repair.

    Try Int() and see what happens. But you might want to review this first https://access-programmers.co.uk/for...d.php?t=216046

    Date is a reserved word, should not used reserved words as names.
    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.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    whilst at it Time is also a reserved word

    Also check you have not dropped a library in vba references. As a minimum you should have

    Visual Basic for Applications
    Microsoft Access XX.0 Object Library
    OLE Automation

  4. #4
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    The most common cause I have seen for the built-in functions, like Format(), to become UNDEFINED is when there is a reference library marked as MISSING.

    To check the references:
    1) Open the VBA editor (Alt-F11).
    2) On the menu go to Tools > References.
    3) At the top of the list, there will be some with a check. These are the ones being used.
    4) If any have a prefix of MISSING then this will cause the issue.


    After yu fix the references, in the VBA editor oo to Debug > Compile. If it does com compile without errors, you will need to fix the code.

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

Similar Threads

  1. Now Function Custom Format
    By DrJohn in forum Access
    Replies: 9
    Last Post: 03-16-2016, 09:51 AM
  2. Replies: 1
    Last Post: 03-18-2015, 09:17 AM
  3. Replies: 3
    Last Post: 01-29-2013, 04:34 AM
  4. Format in Dlookup function
    By tpcervelo in forum Forms
    Replies: 6
    Last Post: 10-22-2010, 10:23 AM
  5. Replies: 3
    Last Post: 08-24-2010, 09:26 AM

Tags for this Thread

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