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

Putting three different Passwords on three different forms???? 1

Status
Not open for further replies.

chubby

Programmer
Apr 28, 2001
278
US
Is there an easy way to password protect forms in my data base. I don't know VBA or SQL so bear with me if I ask a ton of questions. (PLEASE!!!!)

At work we're using Access 97 on a network. All the permissions and groups are already setup. But they still want passwords so one can get access to there section.

There are three levels:
Me, Dan and Ivy Admin
Data Entry 6 folks Read/write only
General Users 80 folks Read only

The data entry personnel want their forms so none of the read only personnel can view their forms. So is there an easy way to do this without going crazy???? Remember I'm weak in SQL and VBA...
Thanks
 
Hi!

I think following function will help you to solve your problem:

Function IsUserInGroup(Optional strUser As String = "", Optional strGroup As String = "") As Boolean
'This function verify user's permissions and
'return True if user have needed user group

'If is omitted strUser (user name), CurrentUser is verified
On Error GoTo Err_IsUserInGroup
Dim usr As User

If strUser = "" Then strUser = CurrentUser
If strGroup = "" Then strGroup = "Admins"

Set usr = DBEngine.Workspaces(0).Groups(strGroup).Users(strUser)
IsUserInGroup = True

Exit_IsUserInGroup:
Exit Function

Err_IsUserInGroup:
If Err.Number <> 3265 Then
'3265 >>> Item not found in this collection.
MsgBox &quot;Error No &quot; & Err.Number & vbLf & Err.Description, , &quot;Function IsUserInGroup&quot;
End If
Resume Exit_IsUserInGroup

End Function


Aivars


 
Aivars, thanks for the tip, but where do I put this function??? Do I open an expression, or the code builder section, then where does it go?? Can I then cut and paste this in or will I have to do some more work???? Remember, I have no SQL or VBA under my belt...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top