G
Guest
I copied a Module from one secured database to another secured database (both
Access 2000). The module works in the first database but does not work in
the other. The code is as follows:
Option Compare Database
Function faq_IsUserInGroup(strGroup As String, strUser As String) As Integer
' Returns True if user is in group, False otherwise
Dim ws As Workspace
Dim grp As Group
Dim strUserName As String
On Error Resume Next
Set ws = DBEngine.Workspaces(0)
Set grp = ws.Groups(strGroup)
strUserName = ws.Groups(strGroup).Users(strUser).Name
faq_IsUserInGroup = (Err = 0)
End Function
When I run the code in the database I copied it to, the line Dim ws As
Workspace is shown to be a compile error: User defined type not defined. I
try to retype Workspace in the Dim line, and the list that pops out does not
include Workspace in there.
I am trying to run the code to see if the user is a member of a certain
group. I know something was posted months ago and I obtained the code from
that.
Any help is great! MIKE
Access 2000). The module works in the first database but does not work in
the other. The code is as follows:
Option Compare Database
Function faq_IsUserInGroup(strGroup As String, strUser As String) As Integer
' Returns True if user is in group, False otherwise
Dim ws As Workspace
Dim grp As Group
Dim strUserName As String
On Error Resume Next
Set ws = DBEngine.Workspaces(0)
Set grp = ws.Groups(strGroup)
strUserName = ws.Groups(strGroup).Users(strUser).Name
faq_IsUserInGroup = (Err = 0)
End Function
When I run the code in the database I copied it to, the line Dim ws As
Workspace is shown to be a compile error: User defined type not defined. I
try to retype Workspace in the Dim line, and the list that pops out does not
include Workspace in there.
I am trying to run the code to see if the user is a member of a certain
group. I know something was posted months ago and I obtained the code from
that.
Any help is great! MIKE