Applying password to a button

  • Thread starter Thread starter neon_cyber
  • Start date Start date
N

neon_cyber

Hi everyone,
Basically I was wondering if any one could
show me how to apply a password onto a button. So that
when I click on this button a message box will pop and
ask for a password in order to go to the next form.
Please help!
 
-----Original Message-----
Hi everyone,
Basically I was wondering if any one could
show me how to apply a password onto a button. So that
when I click on this button a message box will pop and
ask for a password in order to go to the next form.
Please help!
.

On the click event for the button add the following code.

dim strPW as string

strPW = inputbox("Please enter password to go to next
form","Enter Password")

if strPW = "password" then 'or what ever you want it to be
docmd.openform "Next form"
else
msgbox "The password did not match, please try again."
end if

That should do it.
 
Back
Top