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

I have the answers BUT what do I do NEXT???

Status
Not open for further replies.

chubby

Programmer
Apr 28, 2001
278
US
I wanted to know if there was an easy way to password protect three different forms in my data base. I don't know VBA or SQL (so bear with me) I got a response from Aivars (Programmer) Jun 7, 2001. Aivars said this would solve all my problems... The ony problem is NOW WHERE DO I PUT THIS??? WHAT DO I DO NEXT??? I'm lost and I really need for this to work by Monday... SOS!!!!

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

HELP PLEASE!!!!

 
Hiya,

I think what you have is some VBA code (I don't know VBA, but that it what it looks like to me), so I think that you need to copy this code into the modules tab of your Access database.......I hope.

HTH, if not, try posting it in the Access forum see if somebody can help you further,

Tim
 
Yes, that is indeed VBA code and you will need to get into coding for that solution to work. The only wasy to achieve password protection without using code is at the database level via the built in security features.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top