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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security on Button/datasheet form within database

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
US
In checking the help file, I have not been able to find my answer.

Have a database that at least a couple hundred people will be viewing by going into the switchboard and selecting the button for the report they are looking for.

I do have a button on the main switchboard that leads to a separate form for the individual(s) with authorization to update the files. On this separate form are 2 buttons; (1)a button used to access the datasheet form and make appropriate updated entries and (2) a button used to run a Macro that will transfer information from the datasheet to an excel spreadsheet. Is there a way that when a person selects the button on the switchboard, that they will be prompted for a secure password? I am thinking that if it can be done, it will require writing code, of which I do not know how I would do that. Can someone please advise?
 
Your button should have the following code.


Private Sub open_Form_Click()


Dim strtInput As String

strInput = InputBox("Please enter password")
If strInput = "password" Then
DoCmd.OpenForm "Open_Form_Name"
Else
MsgBox "wrong password"
End If

End Sub
 
I am trying to do something similar. Basically I have no idea about setting passwords up in access. After many attempts to set up user level security, I have it rigged. @ tables for passwords, on for mgmt and one for team leads. These are then linked to the queries that go to the reports each is allowed to access. I have a switchboard setup. The main has 2 options, team reports and mgmt reports. I want it to prompt for the password when the mgmt button it clicked rather than entering it a multiple of times they click another button on the next pasge of the switchboard. I tried a macro, but I can not get it to work. I do not know much about code. The above would be great, but I dont know where it should go in the code. I clicked the secong button in design view, then went to code. I added the above to the end of the code and it did nothing. I know this is a bizarre was to handle it, but I do not know any other way to get teh results I need. I don't think I can use newtowrd IDs either. ANy help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top