Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006

    Unanswered: Input Mask for a date

    I currently have an Input Mask of 00/00/0000 for a few date fields on a form, but I don't like it because if I enter 5/16/2008, for example, it says the input doesn't conform to the mask. It requires me to enter 05/16/2008. I think it's not natural to have to enter the leading zero for the month. Also, it would be nice if I could just enter 5/8/2008 and have it resolve to 05/08/2008. Any way to do this?

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Even better is to allow the user to key in 5/8 and the system expands it out assuming the current year. This is really easy. Here's how:

    Don't use an input mask.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    You could use the Input Mask 09/09/0099 which allows for one or two digits in the month/day part of the date and two or four digits in the year part. I have to say, however, that I find that using Input Masks actually slows down/makes entry harder, and never use them myself.

    To "resolve" the date as you want it, go to the Format Property for the textbox and enter mm/dd/yyyy. If you enter 5/8/08 or 5/8/2008, 05/08/2008 will be displayed when you move off of the textbox.

    If you don't use the Input Mask, you can simply enter 5/8 as StartTrekker suggested, and 05/08/2008 will be displayed.

    Last edited by Missinglinq; 05-18-08 at 21:53.
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts