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

    Report text box for date(=Date()) fails in Access 2007 Runtime. Perfect in AC2007 Full version.

    In both cases I'm using an MDE.



    I have a text box on a report header, with the Control Source value set to: =Date(), Format: Long date, control name: Date.
    Running with Access 2007 full version (Win 7 Pro), this field ends up with the correct long date on the report as desired, but using Access 2007 runtime (Win 10), the result is: #Name?

    A use of =Now() for this purpose (in page footer) seems to work with either Access RT or full (used in Page Footer).
    Is this a legacy use of =Date()?

    Any advice appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Smells to me like a reference issue. Date() is still perfectly valid, but a reference problem can cause odd issues like this.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    control name: Date
    this might be your problem, should not use reserved words for table/field/control names.

  4. #4
    Edward_ is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    38
    I changed the field name to txtDate and the control source to: =Now().
    All is well.

    Thanks

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm curious if it works with Date() now, since you said it worked with Now() anyway.

    I didn't notice that the control had the same name, which could also have caused the problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    changed the field name to txtDate
    presume you mean the control name?

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

Similar Threads

  1. Replies: 2
    Last Post: 01-18-2017, 09:11 AM
  2. Replies: 3
    Last Post: 09-09-2015, 03:11 PM
  3. Replies: 3
    Last Post: 01-08-2013, 11:51 AM
  4. Replies: 1
    Last Post: 10-04-2011, 02:39 PM
  5. Code works in full, fails in Runtime
    By stephenaa5 in forum Programming
    Replies: 3
    Last Post: 09-14-2010, 12:30 PM

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