Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,077

    Simple Date formatting


    I have a text box "DOE" intended for entry of a date. The format for the control is set to "Short Date". So for example, if a user enters 8/8 the date will appear as 8/8/2014 but, as it is now, ONLY if the control loses the focus. If the user presses Enter, the field will become blank and remain that way until the control loses the focus. My question is what is required to force formatting properly when ENTER is pressed.

    Thanks,
    Bill

  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
    53,632
    Could try an input mask and/or default value. I use:

    InputMask: 99/99/"20"00;0;

    DefaultValue: =Date()

    ValidationRule: <=Date()
    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
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,077
    Those changes to the table def for DOE had no affect on the behavior. I.e., the use of ENTER still blanks the field until the control loses the focus, at which time the field is properly formatted and displayed.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What do you mean by 'changes to the table def'. Set properties of textbox, not table fields. All works for me.
    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.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,077
    In the "Other" properties of the control, there's an attribute I'd not seen "Enter key behavior". Everything worked great after I set that to "Default"...............good grief!!

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

Similar Threads

  1. Formatting date to have leading zero for DAY
    By Praveenevg in forum Access
    Replies: 13
    Last Post: 08-20-2014, 01:27 PM
  2. Date/Time Formatting
    By cuddles in forum Access
    Replies: 5
    Last Post: 06-11-2014, 02:44 PM
  3. Have I missed something with date formatting?
    By Ruegen in forum Programming
    Replies: 8
    Last Post: 11-12-2013, 04:02 PM
  4. Replies: 0
    Last Post: 03-11-2013, 07:57 PM
  5. Formatting a date
    By NISMOJim in forum Queries
    Replies: 7
    Last Post: 09-17-2010, 05:44 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