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 Request
Im doing a Database, and I created command buttons to open a form, I dont
know if there is a possibilitie to do the following: When someone click on one of the command button that request a password to get into the form to add or edit or delete a registry. Is this possible? Thank You So Much |
#2
|
|||
|
|||
Password Request
Billy wrote:
Im doing a Database, and I created command buttons to open a form, I dont know if there is a possibilitie to do the following: When someone click on one of the command button that request a password to get into the form to add or edit or delete a registry. Is this possible? Thank You So Much Rather than putting the password prompt in the button's code, put it into the Open event of the form. Then it will occur no matter how the form is opened. Plus, you can open the form from multiple places and don't have to re-write the password code every time. In the Open event... If InputBox("Please Enter Password") "YourPassword" Then MsgBox "Password Incorrect" Cancel = True End If Now, this is rather crude. The password is not masked with asterisks while being entered. In addition you have to give your users an MDE file or else they would be free to look at the code and see what the password is. It's not what I would call "security", but in many cases it accomplishes what you want. Another way to go would be to hide everything on the form except for a TextBox in the middle labeled "Password". In its AfterUpdate you run similar code except for the Cancel = True part. This allows you to use an InputMask of "Password" so that the user does see asterisks as he types and it allows the user to try as many times as he wants rather than immediately closing the form when the password is wrong. When they get it right, you hide the password TextBox and display everything else. If in your case you don't care about viewing, but only editing, you toggle the AllowAdditions, AllowEdits, and AllowDeletions properties of the form when the password is entered instead of toggling visibility. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|