Results 1 to 7 of 7
  1. #1
    dfean is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    14

    Validation rule for Expiry Date for credit card in Microsoft Access

    Hiya all,

    I'm wondering how to apply a validation rule for and expiry date of a credit card.

    Format: mm/yy
    Input mask: 99/99


    Validation rule: <=Date()+1095

    this doesn't work and I don't know what the validation rule could be.

    Could somebody help me please?

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I got this to work if you change up to as follows:
    Format: mm/dd/yy
    Input mask: 99/99/99
    Validation rule: <=DateAdd("d",1095,Date())

    Of course this means that you would have to enter the dates showing the last day of the month of expiry.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would suggest using the BeforeUpdate event of the control on the form. Much more flexible than using a validation rule in a table.

  4. #4
    dfean is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    14
    Thank this works perfectly.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome. Thanks for posting back with your success.

  6. #6
    dfean is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    14
    This also works perfectly too thanks.


    Quote Originally Posted by alansidman View Post
    I got this to work if you change up to as follows:
    Format: mm/dd/yy
    Input mask: 99/99/99
    Validation rule: <=DateAdd("d",1095,Date())

    Of course this means that you would have to enter the dates showing the last day of the month of expiry.

  7. #7
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You are welcome.

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

Similar Threads

  1. Validation Rule for Date Format
    By selvakumar.arc in forum Forms
    Replies: 3
    Last Post: 03-04-2014, 01:31 PM
  2. Cannot set validation rule on Date/Time type
    By intheflesh77 in forum Access
    Replies: 2
    Last Post: 10-12-2013, 08:57 AM
  3. Replies: 2
    Last Post: 08-24-2011, 12:59 PM
  4. Credit Card Info, Where?
    By mastromb in forum Access
    Replies: 3
    Last Post: 05-26-2010, 12:37 AM
  5. Validation Rule: Date
    By krymer in forum Access
    Replies: 0
    Last Post: 08-27-2008, 03:30 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