Results 1 to 3 of 3
  1. #1
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60

    Text Box trying to set the Default Value to a date being converted to 1905-random Month / Random Day

    Am just trying to set the default value (on the form, not programmatically) of a text box to a date but with every attempt it either fails or sets the date to 1905-randmon month & random day.


    I've tried a few different methods from various online sources... feeling like a newb here...

    =Now() works fine.

    Any attempt to set to an actual date returns 1905-Random Month-Random Day ?!?

    I am trying to set it to the 1st day of the current month.

    Text Box is formatted as Short Date - Regional settings are set to the ISO standard numeric date format YYYY-MM-DD.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    What is the code that doesn't work?

    Now() is an actual date.

    Textbox is bound to date/time field?

    =DateSerial(Year(Date()), Month(Date()), 1)
    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
    RyanP is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    60
    Nice. finally got the syntax right, came here to mark it solved. And noticed you (June7)posted the same syntax.

    =DateSerial(Year(Date()),Month(Date()),1)

    The text box was unbound. Still a newb and not sure exactly why trying to set it without 'Serial' was failing and producing random dates in 1899 / 1905 though.

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

Similar Threads

  1. Replies: 5
    Last Post: 06-02-2015, 02:51 PM
  2. Replies: 2
    Last Post: 07-09-2013, 06:31 PM
  3. Random Default Value Combo Box Selection
    By sking89 in forum Programming
    Replies: 2
    Last Post: 01-02-2012, 12:17 PM
  4. Random Text and Numbers
    By Mclaren in forum Programming
    Replies: 5
    Last Post: 11-05-2010, 04:34 AM
  5. Creating A Table of Random Date
    By kimimaro_kiddo in forum Access
    Replies: 1
    Last Post: 01-01-2010, 10:20 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