Results 1 to 5 of 5
  1. #1
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33

    2021

    Good day! when i enter dates for December, it would be Dec 2021... is there a way that December is 2020 and January 2021? TIA!

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    perhaps in the control afterupdate event put something like

    Code:
    if month(mycontrol)=12 and year(mycontrol)=year(date) then
    
        mycontrol=dateadd("yyyy",-1,mycontrol)
    
    end if
    or

    Code:
    if mycontrol>date then mycontrol=dateadd("yyyy",-1,mycontrol)
    really depends on your actual requirements - what if they really want to enter a date in dec 2021? You would need to include a msgbox to verify it was ok to change the year

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Are you really saying if you enter 12/25/2020 it is becoming 12/25/2021?

    How, exactly, are you entering these dates?

    Linq ;0)>

  4. #4
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33
    25/12 for Dec 25, 2020

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Perhaps check if current month < 6 and if so subtract 1 year from date entered.?
    By the time you get to June you will likely be wanting to put in December as 2021 ?
    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

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

Similar Threads

  1. Replies: 3
    Last Post: 02-03-2020, 05:23 PM

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