Results 1 to 3 of 3
  1. #1
    namtip is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    5

    Setting a default Value results in #Name? error

    Hi all,



    My form has a textbox in which I want the user to type a week number, which then brings up a list of records with start and end dates/times within that week in a query subform.

    This works perfectly.

    However, all I want to happen, is that when the user first opens the form, the textbox defaults to this week's number. I have the expression =Format([Date()],"ww") in the Default Value field for the textbox, but this results in the #Name? error. I can still manually enter the current week number in over the #Name? error and the query runs perfectly.

    I feel I am missing something really simple somewhere. I've been up since 3am trying to get this form to work. This is the last thing standing in my way. You are my last hope!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Don't need = sign. Remove the [] characters. Those define an object name. Date() is a function.
    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
    namtip is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    5
    Quote Originally Posted by June7 View Post
    Don't need = sign. Remove the [] characters. Those define an object name. Date() is a function.
    Thank you so much! Now you mention it it seems so obvious - but I would never have realised what I was doing wrong by myself.

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

Similar Threads

  1. Setting default with an IIF Function
    By cptdave1996 in forum Access
    Replies: 14
    Last Post: 12-14-2015, 01:57 PM
  2. Setting default
    By Thompyt in forum Programming
    Replies: 10
    Last Post: 11-10-2014, 11:49 AM
  3. Setting a default value of 0 in a query
    By Access_Novice in forum Queries
    Replies: 1
    Last Post: 10-23-2014, 11:41 PM
  4. Setting default value to zero in form box?
    By dekhelia in forum Forms
    Replies: 6
    Last Post: 10-17-2013, 08:53 AM
  5. Setting default vaulue?
    By djclntn in forum Forms
    Replies: 17
    Last Post: 04-12-2012, 11:20 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