Thanks John for your response, what intended to do is to make the file MDE
after i put the VBA to make it expire in 15 days, that is why if you could
just continue my VBA maybe to put a Today as a constant? then minus 15 if
Const < then something can not open.
Thanks for your help

Signature
H. Frank Situmorang
> >Hello,
> >
[quoted text clipped - 21 lines]
> Just be aware that this is very weak security; anyone who can open the form in
> design view or locate your stored date can break it.
John W. Vinson - 14 Mar 2008 05:54 GMT
>Thanks John for your response, what intended to do is to make the file MDE
>after i put the VBA to make it expire in 15 days, that is why if you could
>just continue my VBA maybe to put a Today as a constant? then minus 15 if
>Const < then something can not open.
>
>Thanks for your help
The trouble with that is that you must edit the code and put in the start date
yourself. Suppose the person is unable to open the database for two weeks?
They only get one day to test it!
If that is what you want to do, then yes, you can hardcode the date:
Private Sub txtPassword_AfterUpdate()
Dim dtStart As Date
dtStart = #2008-03-14# ' you must edit this date for each customer
If DateDiff("d", dtStart, Date) > 15 Then
MsgBox "Test period has expired"
Application.Quit ' exit the database
End If
If Me.txtPassword = "hfs1754" Then
DoCmd.OpenForm "Switchboard"
DoCmd.Close, acDataForm, Me.Name
Else
MsgBox "Password yang dimasukkan salah"
'Do something else
Application.Quit ' if you want the user to be thrown out
DoCmd.Close
End If
End Sub

Signature
John W. Vinson [MVP]