How do I Allow Dates Without Separators, but Show Them With Separators

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HelpNeed
    New Member
    • Feb 2012
    • 2

    How do I Allow Dates Without Separators, but Show Them With Separators

    Having the ability to enter date in 2010 access form without seperators but date is displayed with seperators.
    Example date is entered as 01222010 (which January 22nd,2010)but displayed as 01/22/2010.
    Would like help as to how to achieve the above
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Open the textbox in question and find the format property. Write "mm/dd/yyyy".

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      You should prepare your question better before posting. This doesn't make what you want very clear at all. Please remember in future.

      I'm understanding you would like the operator to enter an 8-digit string and have that interpreted as a date. If so, then formatting won't be enough for you. You will need to write some code in a BeforeUpdate() event procedure which validates and converts the string (which is not a generally recognised or supported date format) into a format that is that as well as unambiguous. The format of the control (or even the field it's bound to if bound) should be as suggested by Smiley in post #2 (mm/dd/yyyy).

      Comment

      • HelpNeed
        New Member
        • Feb 2012
        • 2

        #4
        Originally posted by TheSmileyCoder
        Open the textbox in question and find the format property. Write "mm/dd/yyyy".
        The form is bound to the table. I went into the design view of the table and the chose in data type Date/Time. In Format (under General) I inital had short date but changed that to "mm/dd/yyy". However entering the date in form as a string does not result date being displayed with separators.
        Last edited by NeoPa; Feb 27 '12, 03:17 PM. Reason: Fixed spelling of "separators".

        Comment

        Working...