Date Verification Log In

AJordan

Registered User.
Local time
Today, 01:23
Joined
Mar 25, 2008
Messages
73
I created a very simple code that checks the current date, and if the the current date is greater or less than the pre programmes date open a msg box.

Code:
Private Sub Command1_Click()
If Date < 1 / 20 / 2010 Then
   Dim ButtonClicked
   ButtonClicked = MsgBox("Sorry, your current license has expired. Please contact administrator to renew", vbOKOnly)
Else
   DoCmd.OpenForm ("frmMain")
End If

I know it works, albeit in reverse of how I thought the < or > would, but is there a better way to do this. I know it's not the most secure code ever written but it will do the job that I need it to. I randomly came up with this but I am more than open to better options.
 
Assuming that #1/20/2010# is the last date before expired.

Have you tried:

Code:
If Date > #1/20/2010# Then
 

Users who are viewing this thread

Back
Top Bottom