If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
password-protected form
Katherine wrote:
Is it possible to password protect a form rather than the entire Database? Gerald Stanley replied: Something along the lines of Private Sub Form_Open(Cancel As Integer) Const strFormPassword As String = "Password" If InputBox("Please Enter Password") strFormPassword Then MsgBox "Password Incorrect", vbOKOnly Cancel = True End If End Sub I have a commond button on form1 that opens the password-protected form2. If incorrect password is entered, the code above shuts form1 which was opened originally. Can this code be altered in such way that form1 remains open if incorrect password is entered, and possibly with a pop-up message asking to try again? Sorry that I am not code literate at all. Thanks for any help! Sam |
#2
|
|||
|
|||
password-protected form
"Sam Kuo" .(donotspam) wrote in message
... Katherine wrote: Is it possible to password protect a form rather than the entire Database? Gerald Stanley replied: Something along the lines of Private Sub Form_Open(Cancel As Integer) Const strFormPassword As String = "Password" If InputBox("Please Enter Password") strFormPassword Then MsgBox "Password Incorrect", vbOKOnly Cancel = True End If End Sub I have a commond button on form1 that opens the password-protected form2. If incorrect password is entered, the code above shuts form1 which was opened originally. Can this code be altered in such way that form1 remains open if incorrect password is entered, and possibly with a pop-up message asking to try again? If the code behind the button is closing Form1 then there has to be a statement in the code that is doing so. It would look like... DoCmd.Close (possibly more arguments here) Just find that line and remove it. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
password-protected form
How do you clear or reset the password?
"Sam Kuo" wrote: Katherine wrote: Is it possible to password protect a form rather than the entire Database? Gerald Stanley replied: Something along the lines of Private Sub Form_Open(Cancel As Integer) Const strFormPassword As String = "Password" If InputBox("Please Enter Password") strFormPassword Then MsgBox "Password Incorrect", vbOKOnly Cancel = True End If End Sub I have a commond button on form1 that opens the password-protected form2. If incorrect password is entered, the code above shuts form1 which was opened originally. Can this code be altered in such way that form1 remains open if incorrect password is entered, and possibly with a pop-up message asking to try again? Sorry that I am not code literate at all. Thanks for any help! Sam |
#4
|
|||
|
|||
password-protected form
"blanch2009" wrote in message ... How do you clear or reset the password? I think you need to tell us which password in which version of Access, before anyone can give you a good answer. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley |
#5
|
|||
|
|||
password-protected form
I'm sorry,
I was using the comments in this thread to password a form in Access 2007. The code that was suggested works "ok", the password window pops open but you can see the password as it's typed, not good in most situations and then the first time you type a password I'm assuming that password is stored. hidden somewhere. The next time you open the form, the password window opens and you type in the password. I'd say that's ok but I'm testing and would like to reset the password, or allow for another password. I have one person that will be using this form so the one password limitation is ok in this instance. I would like to learn how to create a form that requires a user to enter there name & password before the form can open. Thank you in advance and I'm hoping I've explained what it is I'm trying to do. Don "Arvin Meyer [MVP]" wrote: "blanch2009" wrote in message ... How do you clear or reset the password? I think you need to tell us which password in which version of Access, before anyone can give you a good answer. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley . |
#6
|
|||
|
|||
password-protected form
Unless you are using the MDB format, you cannot secure individual objects
using Access security. Even with Access security you cannot require a password for a single form. What you can do however is determine who the user is using code like: http://www.mvps.org/access/api/api0008.htm Knowing who the user is, can allow you to choose whether or not to allow him/her to access any objects in the database. I typically add a hidden table to the database with permission levels for each user, then store that in a global variable, then check that in the form load or form open event to see if the user has sufficient permissions to access that object. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley "blanch2009" wrote in message ... I'm sorry, I was using the comments in this thread to password a form in Access 2007. The code that was suggested works "ok", the password window pops open but you can see the password as it's typed, not good in most situations and then the first time you type a password I'm assuming that password is stored. hidden somewhere. The next time you open the form, the password window opens and you type in the password. I'd say that's ok but I'm testing and would like to reset the password, or allow for another password. I have one person that will be using this form so the one password limitation is ok in this instance. I would like to learn how to create a form that requires a user to enter there name & password before the form can open. Thank you in advance and I'm hoping I've explained what it is I'm trying to do. Don "Arvin Meyer [MVP]" wrote: "blanch2009" wrote in message ... How do you clear or reset the password? I think you need to tell us which password in which version of Access, before anyone can give you a good answer. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley . |
#7
|
|||
|
|||
password-protected form
Thank you Arvin for your reply.
I have no coding experience and don't know how to do what your suggesting. I followed your link to the code that will call for the user name and built a module for the code to reside in but I have no idea what to do with it now. This all sounds very difficult to do. Thanks Arvin Don "Arvin Meyer [MVP]" wrote: Unless you are using the MDB format, you cannot secure individual objects using Access security. Even with Access security you cannot require a password for a single form. What you can do however is determine who the user is using code like: http://www.mvps.org/access/api/api0008.htm Knowing who the user is, can allow you to choose whether or not to allow him/her to access any objects in the database. I typically add a hidden table to the database with permission levels for each user, then store that in a global variable, then check that in the form load or form open event to see if the user has sufficient permissions to access that object. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley "blanch2009" wrote in message ... I'm sorry, I was using the comments in this thread to password a form in Access 2007. The code that was suggested works "ok", the password window pops open but you can see the password as it's typed, not good in most situations and then the first time you type a password I'm assuming that password is stored. hidden somewhere. The next time you open the form, the password window opens and you type in the password. I'd say that's ok but I'm testing and would like to reset the password, or allow for another password. I have one person that will be using this form so the one password limitation is ok in this instance. I would like to learn how to create a form that requires a user to enter there name & password before the form can open. Thank you in advance and I'm hoping I've explained what it is I'm trying to do. Don "Arvin Meyer [MVP]" wrote: "blanch2009" wrote in message ... How do you clear or reset the password? I think you need to tell us which password in which version of Access, before anyone can give you a good answer. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access Co-author: "Access 2010 Solutions", published by Wiley . . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Form Doesn't Go To New Record | Steve | New Users | 15 | May 16th, 2004 04:33 PM |
Prevent access to macro's if sheet is password protected | Frank Kabel | Worksheet Functions | 2 | May 2nd, 2004 06:22 PM |
Prevent access to macro's if sheet is password protected | sonar | Worksheet Functions | 0 | May 2nd, 2004 04:34 PM |
Changing dsn connection information (Password) | Mike N | Worksheet Functions | 2 | December 3rd, 2003 08:04 PM |