Results 1 to 2 of 2
  1. #1
    ExtremeNovice is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Posts
    24

    Data Entry Form: How to cut the short date to just mm/dd/yy and have the century (19or20) autofill

    I have a data entry form where I will be entering customer birth dates. I will have several hundred customers a day so every keystroke that I can cut out is a win. I have my birth dates in short date format and I would like to cut out the first two year numbers from the data entry process. The challenge is some birth dates are in 1900's and some are in the 2000's. What is the best set it up where I can enter a date in MM/DD/YY format and have the correct century (19 or 20) auto fill. I am not concerned about customers that are over 100 years old and, obviously there will never be birthdays that are beyond the current date.


    Thanks!

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    so basically if date enter is greater than today, you want to deduct 100 years

    if so then in the date control afterupdate event put

    if mydatecontrolname>=date() then mydatecontrolname=dateadd("yyyy",-100,mydatecontrolname)

    you may need to change date() to an earlier date (use the dateadd function to deduct required number of years or alternatively use a specific date) since your post is not clear as to when to deduct 100 years - for example someone born in 2016 or 1916?

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

Similar Threads

  1. Replies: 1
    Last Post: 12-28-2016, 11:39 AM
  2. How to add Short Date to Field
    By nono5551212 in forum Access
    Replies: 2
    Last Post: 06-06-2014, 10:55 PM
  3. Changing the century part of the date.
    By Chet in forum Queries
    Replies: 2
    Last Post: 05-13-2012, 08:27 PM
  4. Replies: 1
    Last Post: 11-21-2011, 01:09 AM
  5. Short date comparison
    By andy101 in forum Programming
    Replies: 2
    Last Post: 03-17-2011, 04:36 AM

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