ok piggybacking on BoxHead with step-by-step instructions:
create a table with one field, a text field called CurrentPassword. table name = tblPAID.
make a little pop-up form that's called frmPASSWORD. base it on tblPAID.
with:
Label: 'ENTER PASSWORD:'
Text box: called txtPassword with input mask = password (will be ******* when they type)
Button btnCheckPassword with caption OK and don't use the Wizard
Text Box (visible=no) control source = CurrentPassword.
for the button OnClick event, choose Event Procedure
(i've chosen at random the formula. you can do what you want, and for every month you will calculate and distribute this password as people pay up). Since when the month changes the formula will change, it will no longer match the CurrentPassword and the pop-up frmPassword will come up until they put in the correct password:
type this in between the Sub() and EndSub() lines:
Code:
Private Sub btnCheckPassword_Click()
if forms!Password!txtPassword = (15564 * month(date())) + 211 then
me.CurrentPassword = me.Password
docmd.openForm "MainScreen"
else
msgbox "Sorry this is wrong Please try again"
me.txtPassword.setfocus 'will put the focus in the txtPassword box so they can try again
end if
End Sub()
then, so they only have to do this once per month, instead of every day so they won't be irritated, we'll check to see if they have already entered the correct password for the month. BoxHead said to declare a variable and set it to no on the first of the month, maybe boxhead you can elaborate cause i dont really get it cause i dont see how the variable can exist after the program is closed. i dont know much about that stuff. here's what i (hack job?) would do:
in the form frmPassword OnOpen event, put this:
Code:
if me.currentpassword = (15564 * month(date())) + 211 then
docmd.closeform "frmPassword"
docmd.openForm "MainScreen"
end if
But yes BoxHead is right: unscrupulous people can do all sorts of things if they know enough, re: changing system date/time.....
also like BoxHead i'm sure there are more elegant ways of doing this, but hope this gets you thinking....