Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

How to make this pasword will expires in 15 days

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Situmorang - 14 Mar 2008 02:51 GMT
Hello,

This is my VBA for pasword in the textbox, How can I make it expires in 15
days after they 1st run it in their computer.

Private Sub txtPassword_AfterUpdate()
If Me.txtPassword = "hfs1754" Then
   'Do something
   DoCmd.Close
   DoCmd.OpenForm "Switchboard"
Else
   MsgBox "Password yang dimasukkan salah"
   'Do something else
   DoCmd.Close
End If
   
End Sub

Thanks in advance

Signature

H. Frank Situmorang

John W. Vinson - 14 Mar 2008 04:20 GMT
>Hello,
>
[quoted text clipped - 15 lines]
>
>Thanks in advance

You will need to store the date of the first run somewhere, in a table
perhaps, and check that date.

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.

Signature

            John W. Vinson [MVP]

Frank Situmorang - 14 Mar 2008 05:25 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
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]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.