M
Matt Howard
I am using a code from the Security FAQ that verifies
whether or not a user is in a group to enable an object on
a form. It works in one database, but the other I get a
compile error saying the user-defined type was not
declared (more or less). Here is the code, word for word
from the FAQ in my database:
Function faq_IsUserInGroup(strGroup As String, strUser As
String) As Integer
' Returns true if user is in group, False otherwise
' This only works if you're a member of the Admins group
Dim ws As WorkSpace
Dim grp As Group
Dim strUserName As String
Set ws = DBEngine.Workspaces(0)
Set grp = ws.groups(strGroup)
On Error Resume Next
strUserName = ws.groups(strGroup).users(strUser).Name
faq_IsUserInGroup = (Err = 0)
End Function
There is nothing different from this database and my other
one. "Dim ws As WorkSpace" is the line that returns the
error.
Any help would be great.
Thanks,
Matt Howard
whether or not a user is in a group to enable an object on
a form. It works in one database, but the other I get a
compile error saying the user-defined type was not
declared (more or less). Here is the code, word for word
from the FAQ in my database:
Function faq_IsUserInGroup(strGroup As String, strUser As
String) As Integer
' Returns true if user is in group, False otherwise
' This only works if you're a member of the Admins group
Dim ws As WorkSpace
Dim grp As Group
Dim strUserName As String
Set ws = DBEngine.Workspaces(0)
Set grp = ws.groups(strGroup)
On Error Resume Next
strUserName = ws.groups(strGroup).users(strUser).Name
faq_IsUserInGroup = (Err = 0)
End Function
There is nothing different from this database and my other
one. "Dim ws As WorkSpace" is the line that returns the
error.
Any help would be great.
Thanks,
Matt Howard