General question about dates and expiration

yanliang

New member
Local time
Today, 16:37
Joined
Sep 10, 2020
Messages
7
I am a new starter on learning about access and database.
I ran into a problem that is in the field of CardExpirationDate. An expiration date that has past or is within 30 days of the current date should not be allowed. Any expiration date that is more than 30 days into the future is acceptable.

I don't know what to type into the violation rules.
Please help.

Thank you
 
Hi. Welcome to AWF!

Didn't you already get some help on that same question in your other thread?
 
Something like

Code:
If CardExpirationDate-Date>30 Then
   'process valid, run your code here
Else
   'show a message and block code
    MsgBox "Your card is close to or has passed its expiry date", vbCritical, "Card validation failed"
    Exit Sub
End If
 

Users who are viewing this thread

Back
Top Bottom