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

Add a Read Only for existing DB for certain users

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have an existing DB that you need a password and an ID to open up. This stores attendace information for several hundred associates. I need to know if and how to add 22 ID's as a read only, where they can view but not edit any records. Can this be done? I'm on a NT network and can not alter Access permissions over the network. I also did not create this DB.
This is the VB for the password and ID:

Private Sub PASSWORD_AfterUpdate()

On Error GoTo err_PASSWORD_AfterUpdate

If Me![PASSWORD] = "xxxx" Or Me![PASSWORD] = "yyyy" Or Me![PASSWORD] = "zzzz" Or Me![PASSWORD] = "aaaa" Or Me![PASSWORD] = "bbbb" Then
gOkToclose = True
Forms!frmForm1!Command7.Enabled = True
Forms!frmForm1!Command7.SetFocus
DoCmd.close A_FORM, "frmPassword1"
Else
' give them three shots at getting it right
Select Case gintpasswordflag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintpasswordflag = gintpasswordflag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "frmPasswordFail1"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
 
The safe way to do this is to use Access security. It's complicated but it is foolproof and will give you the control you need. If you have Access 97, the subject is covered in the book called Building Applications with Microsoft Access 97, which is available electronically on the installation CD.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top