General question about dates and expiration (1 Viewer)

yanliang

New member
Local time
Today, 03:27
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:27
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF!

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

isladogs

MVP / VIP
Local time
Today, 07:27
Joined
Jan 14, 2017
Messages
18,186
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

Top Bottom