Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password protection for a form...Please help!!!!! 2

Status
Not open for further replies.

Nate16

Programmer
Jul 9, 2002
17
0
0
CA
Hello

Is it possible to password protect a button on the main menu, that will not allow the button to begin the macro? Another thing I have considered is a msg box that will pop up and unless the password is entered correctly it will go no further, but so far the only thing I have seen work is making a seperate form to enter the password which I do not want to do because I want as few forms as possible. So, is there a button property, macro, tool, or code for an msg box I could use...Please help!
 
Hi,

You can make a button invisible or disable it. However, how would you know when to do this unless the users identify themselves? dz
dzaccess@yahoo.com
 
Hi,

I would also like to know how to disable a button based on the level of user a user is. Basically, I want to disable my cmdAdd on my frmInputMain for user level, but enabled for admins.

THANKS!
 
Dear Nate16
If there are parts of the database that you wish certain users not to be able to access, surely the place to put that protection is on the primary login?

From that point onwards you can then show forms to certain users as Read only and to others as Editable.

You then only need to create 2 Main forms and you could copy and edit the On_Click events to open the forms as read only and disable/remove any Command buttons that are not relevant.
HTH Regards Jim
 
Hello again,

I want to prevent a form from being opened. So that when the button is clicked it will prompt you for a password to go any further and not execute the macro for the button if an incorrect password is entered into the msg box.

Thanx for listening...
 
James33,

How do you open the main forms according to the type of login?
 
Hello again,

Login names and profiles are too complex a solution for this problem. The database has two parts one part is for data searches while the other is for data entry. The program opens up with a main menu switchboard. What I would like to do is make the entry half inaccessible to users without a password. So if someone clicked a data entry form button, they would be prompted for a password, and only able to open the form if they type the correct password in. I want the search to be as user friendly as possible. So, if someone uses the database to find something they don't have to enter in any password. I also don't want them to have access to tables unless authorized to. It may be difficult, but it would be user friendly and could be easier to do.

Thanx.
Nate 16

Opinions wanted.
 
Dear Nate,
Whatever way you do it, you are going to have to accept either a degree of insecurity or an addition to your workload, having said that:

In the code of your Cmd Button on your main form (Call it CmdBrowseEdit) Put
Do.Cmd Open Form (Your Password Form Name)

Have one TextBox on that form and a 2 Command Buttons,
put in code for the 1st CmdButton, so that when it is pressed it checks the value of the TextBox and if it agrees with your password then your DataSearchForm opens as Editable.
If,Then,ElseIf

If the value of the TextBox is not the password then it stops execution of the code and sets the value of the TextBox to null and returns focus to the TextBox.

Have a 2nd CmdButton that just opens the DataSearchForm as read only.
Include code to close the password entry form after the DataSearchForm is open.
And just in case have a third CmdButton to close the Password form so the user doesn't feel trapped!!
HTH
Regards Jim
 
Dear Nate16,
Just in case you haven't spotted this (You probably have), you could simplify the password Form by putting another ElseIf in the code of the 1st cmdButton so that if the password TextBox isNull it opens the form directly in Browse mode...

If it is not Null i.e. if you entered the wrong password, it would still return you to the TxtBox to re-enter the password, that way your Browse person only has to go once, whereas the administrator has a second chance..

HTH Regards Jim
 
Hi Nate16,

Here is the way that I would do it. Make an unbound field on the form with the button called password. Disable the button on the form. Write some code in the After Update event of the unbound field something like this:

If me.password = "Password" Then

me.button.enabled = True

Else

me.button.enabled = False

That avoids having more than one form.

Hope that helps!

Griz

 
Hey,

Maybe you guys can help me. Is there a way to know what kind of user is logged in using Access security? For example, is there a way to disable a button if the user is a User level?
 
The txtbox idea works great! Thanx for the suggestion. I was wondering if someone knows how to make it so that the password is protected. So that when someone types the password in "******" appears... Any info would be appreciated. Thanks to everyone for their input so far.

Nate

Drivers wanted!
 
Dear buee,
as nate said "Login names and profiles are too complex a solution for this problem"
But there are FAQ's on this forum or check the VB or Access other topics forum if you do an advanced search they will tellyou all you need too much to explain and I am not as experienced as some in that area.
Sorry I didn't reply to you earlier but I am at work and can only fit in the odd suggestion.
Griswom's idea was the best solution here..
HTH
Regards Jim
 
Nate,

Open the properties of the unbound password field. On the data tab under input mask, type "PASSWORD". This will make asterisks appear in the field instead of the letters typed.

HTH,

Griz
 
Thanx for the suggestions and advice everyone...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top