Results 1 to 8 of 8
  1. #1
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122

    Calendar field date default to 19xx instead of 20xx

    How do I set the two digits years to 19xx instead of 20xx. e.g. If I enter 01/01/22, it defaults to 01/01/2022 but I want all these to go to 19xx. I know I can put "19"00 in the format field, but they, I can not change it to 20xx if it happens. Any idea?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You need some sort of rule to decide whether is should be 19xx or 20xx.
    Or you can stop being lazy and enter the other 2 characters?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Perhaps set the default value to a date in the 20th century? User can then use the calendar more easily or just replace the day, month year part. Perhaps set the format to the iso standard of yyyy-mm-dd so user does not have to skip over the 19

    another alternative if you do not have matching years (e.g. 1919 and 2019) have a calculation in the control afterupdate event - something like

    txtdate=dateadd(“yyyy”,(txtdate>date)*100,txtdate)

    all depends on the date range you are entering

  4. #4
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    ty all for the insight. I will Try CJ's suggestions. Ty

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Beware of code posted with smart quotes - those slanted quotes and apostrophes. Access won't like them if you copy/paste that code.
    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.

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Good point - keep forgetting when responding from phone

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Interesting,
    When I post from the phone I get "test".
    I am on Android?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I use an iphone. So far as I know you cannot select a characterset to exclude the smart quotes

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

Similar Threads

  1. Replies: 1
    Last Post: 02-27-2017, 07:30 PM
  2. Replies: 4
    Last Post: 01-04-2015, 02:38 PM
  3. how to get a pop up calendar on a date field
    By accessmatt in forum Forms
    Replies: 3
    Last Post: 11-12-2014, 07:48 PM
  4. Replies: 3
    Last Post: 10-12-2010, 11:15 PM
  5. Set Calendar to default to today's date
    By RickM in forum Access
    Replies: 1
    Last Post: 02-22-2009, 04:51 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