Have database expire in a set time period

robsworld78

Registered User.
Local time
Yesterday, 17:41
Joined
May 31, 2011
Messages
99
Hi, I can't seem to find this anywhere, is it possible to set a database to expire in say a couple days or whatever.

I'm trying to sell this database I'm making to someone and want to give them a trial version to try before buy. I want to set the database to expire in a couple days, no locking out features or anything fancy.

When a date comes, have a form pop-up that says expired and all that good stuff and all a person can do is exit. I know it's simple but not sure where to put in the command.
 
no - it isn't simple

you need to stop users doing any of these:

bypassing your startup routine
getting at the database window
opening a new database, and importing all your stuff into the database

as well as obvious things like
changing the system date
deleting and reinstalling the app

as well as, no doubt, many other "attacks"
 
I don't really wanted to lock it hard core, I just want something simple, its not going to anyone savy. I just want a form to popup automatically when a date arrives. I'll lock the form, and have just a dialog with an exit button and some comments. Because that form is open over everything they can't access anything behind it without closing it and they won't be able to do that. I can hand that part, just need code to open a form automatically.

I'm also giving it with the runtime and packaged up, I tested it with a form that I can close so I could see backstage so to speak and the ribbon was bare and the file section had no options, no even to open a database.

So if it is possible to have a form open automatically then I'm happy.
 
I would just use whatever startup form you have then - in the open event, check the date, and if the date has expired, quite the application.

I would ACTUALLY also write the expired status somewhere else as well, eg a hidden table so they can't get around it by setting the date back.
 
Yeah something like that would work, can I have it open a form instead of closing the program?

Would you what code I would use or what command as in "DLookUp"?
 
If I use the following code it will open the employees form on open however it does it now, it shouldn't until june 10?

Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "employees", acNormal, , "[Date]" = "#6/10/2011#"
End Sub
 
One other thing the form isn't opening over the form that's loaded when the database loads. When I close that form its open behind it.
 
this sort of thing

Code:
Private Sub Form_Open(Cancel As Integer)
if date>= "#June 10th 2011#" then
   'or open your form here instead
   msgbox("Sorry Evaluation Period Expired")
   cancel = true
   exit sub
end if
End Sub

note that you have to be careful about the date comparison - using 6/10/11 may be treated as either Oct 6th, or JUne 10th - I am not sure - its a US/UK thing - always an issue
 

Users who are viewing this thread

Back
Top Bottom