Applying password to a button

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!
 
M

Matt Weyland

-----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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top