Password Protect Form

S

Secret Squirrel

I have a password protected form that I created from the ms.support website
(Q209871). I added a command button to the frmPassword for users to be able
to open the form in "Read Only" mode. When they click this button the form
opens in read-only but the frmPassword stays open as well. How do I get it to
close the frmPassword form after they click the "Read Only" command button?
 
R

Rick Brandt

Secret Squirrel said:
I have a password protected form that I created from the ms.support website
(Q209871). I added a command button to the frmPassword for users to be able
to open the form in "Read Only" mode. When they click this button the form
opens in read-only but the frmPassword stays open as well. How do I get it to
close the frmPassword form after they click the "Read Only" command button?

DoCmd.Close acForm "NameOfForm"
 
T

Tom Wickerath

Or, better yet, use this:

DoCmd.Close acForm, Me.Name

That way, you don't have the name of the form hard-coded. If you later
change the name of your form, you won't need to change this statement.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

:

Secret Squirrel said:
I have a password protected form that I created from the ms.support website
(Q209871). I added a command button to the frmPassword for users to be able
to open the form in "Read Only" mode. When they click this button the form
opens in read-only but the frmPassword stays open as well. How do I get it to
close the frmPassword form after they click the "Read Only" command button?

DoCmd.Close acForm "NameOfForm"
 
S

Secret Squirrel

Thanks for the input Tom! I'll do this instead and keep this in mind for
other commands.
 

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