Date without seperator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reginaldmerritt
    New Member
    • Nov 2006
    • 201

    Date without seperator

    Data is entered into access from an application form. On the application form the applicants date of bith is written as ddmmyyyy with no seperators.

    Users of the access program always try to enter the applicants date of birth as ddmmyyyy rather than using the seperators dd/mm/yyyy.

    Access doesn't like this and throws up an error.

    Is there anyway of getting around this ?

    Apart from constantly reminding the user of the data entry rules or changing the application form.
  • reginaldmerritt
    New Member
    • Nov 2006
    • 201

    #2
    By the way tried using CDate, but CDate will take a date entered as ddmmyyyy as one whole number, it will not convert it to dd/mm/yyyy

    Comment

    • gershwyn
      New Member
      • Feb 2010
      • 122

      #3
      I would look into using the input mask property of the field they are entering the date into. This way, they can enter just the digits and access will provide the delimiter for them automatically.

      For example, an input mask of
      Code:
      99/99/9999;0;"-"
      will probably work for what you need. The 0 after the first semi-colon says to store the slashes in the underlying table (necessary if you have this bound to a date field for it to be recognized as a date) and the hyphen is the character it displays for data that hasn't been entered yet.

      Change the format property of the field to dd/mm/yyyy if you haven't already done so as well.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        I suppose the obvious question is :
        "Why would you display the date without separators in the first place unless you specifically wanted the operators to enter the data without them?"

        The obvious answer (from what you've shared so far) is to display the date in d/m/yyyy format and the problem will go away.

        If it's more complicated than this then you really need to explain why. What we know so far doesn't give that indication.

        Comment

        • reginaldmerritt
          New Member
          • Nov 2006
          • 201

          #5
          Sorry its not the displaying of the date that is the problem. I want to display the date in the d/m/yyyy format but allow the user to enter the date without the seperator.

          Comment

          • reginaldmerritt
            New Member
            • Nov 2006
            • 201

            #6
            gershwyn your right the input mask did the trick. I asummed as i wanted to remove the entry of the sperator that the input mask wouldn't be the way to go. In fact the input mask enters the seperator for you. Fanbulous.

            Many thnaks.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32653

              #7
              Originally posted by Reginald
              Reginald:
              Sorry its not the displaying of the date that is the problem. I want to display the date in the d/m/yyyy format but allow the user to enter the date without the seperator.
              I guess from the solution, and your last post (Not this quoted one) that you want the date to show proerly formatted (not as ddmmyyyy as in your first post) but that you don't want the operator to have to enter the separators themselves, but have them appear automatically. It really does help if you say what you mean.

              Comment

              • gershwyn
                New Member
                • Feb 2010
                • 122

                #8
                NeoPA: I suspect the confusion here is in the use of the word "form." I took the original post to mean the date was written without a separator on a physical, paper form, and the person doing the data entry had a tendency to enter it into Access as written.

                Of course, "form" can mean something else in Access and reading the post that way, it does seem like the question contradicts itself.

                Comment

                • reginaldmerritt
                  New Member
                  • Nov 2006
                  • 201

                  #9
                  gershwyn you have understood me correctly. You have articulated the issue much better than i could.

                  I used the term 'application form' rather than just 'form', but i can understand NeoPa's confusion over the writting of my post.

                  I guess I should watch my language(or should i say,syntax) when speaking to people whos brains are hard wired for programming terminology. ;)

                  Thanks.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32653

                    #10
                    Originally posted by Reginald
                    Reginald:
                    I guess I should watch my language(or should i say,syntax) when speaking to people whos brains are hard wired for programming terminology. ;)
                    Nice recovery :D

                    Comment

                    Working...