Results 1 to 9 of 9
  1. #1
    Edward_ is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    38

    Using Date() works in Access 2007, but not with Access 2007 Runtime. Gives #Name?

    I have a report field using
    Code:
    =Format(Date(),"Medium Date")
    as the control source.



    This works fine in a Win 7 PC having Access 2007, but when these reports are created on a certain Win 10 PC using Access 2007 Runtime, it displays #Name?.
    Another Win 10 PC using Access 2007 runtime displays the correct date format.

    There are no table fields in the record source named Date. The Region settings in all PCs are identical.

    Any advice greatly appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    possible solution - use the date format rather than description - i.e.

    "dd mmm yyyy"

  3. #3
    Edward_ is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    38
    Thanks Ajax.
    Using "dd mmm yyyy" didn't change anything. #Name? displays.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Edward FYI

    Your expression:
    Code:
    =Format(Date(),"Medium Date")
    works fine for me in an unbound textbox on the footer section of a report in A2019
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Edward_ is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    38
    I'm hearing it could be a missing library.
    Not sure how to check for a missing library (using Access Runtime). Not sure that's possible. How would one know which library is required for a date, or add a library?

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    How would one know which library is required for a date, or add a library?
    it's a VBA function so pretty sure it will be in the VBA library

    but it may be the format function which is the problem - which is in the VBA library

    edit - if you are writing this in vba then you did not copy/paste your code because vba would remove the () after date. So double check your spelling (appreciate it works in full access, so this is just a 'maybe')

  7. #7
    Edward_ is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    38
    I'm not creating this app, we have been using it since 1997.
    I have been updating this app through newer versions of Access.

    All of the VBA code in this app is working correctly. This date unbound text box has no other code, it has the Control Source value:
    Code:
    =Format(Date(),"Medium Date")
    I just changed the control source to: =Date() the same result was displayed, #Name?
    But =Now() does work. Using Format with =Now() does not work.

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    sounds like you may have corruption - have your tried compact/repair?

    also, ensure you have Option Explicit at the top of each module, just below Option Compare Database and then compile you code (in the vba window Degug>Compile).

    Access has become less tolerant of poorly written code with each new version and although I accept this is the controlsource of a control, it could still have an impact - certainly worth a try

  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,518
    It does sound like a reference problem:

    http://accessmvp.com/DJSteele/Access...nceErrors.html

    You might look at what the references are with the full version and you might be able to figure out what's missing on the runtime computer.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 12-09-2019, 05:33 PM
  2. Pivot form works in Access 2007 not 2010
    By arothacker in forum Forms
    Replies: 4
    Last Post: 04-25-2014, 09:43 AM
  3. Replies: 4
    Last Post: 11-26-2013, 02:35 PM
  4. Replies: 3
    Last Post: 03-15-2012, 03:42 PM
  5. Access Runtime 2007 Date Time Picker Vista not working
    By sailinxtc in forum Programming
    Replies: 0
    Last Post: 09-17-2008, 12:56 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