I think you are triyng to do this...no?
------
Sub CheckUserPermsInAccess(strUser As String, _
varObjName As Variant, _
lngCheckRights As ADOX.RightsEnum, _
lngObjectType As ADOX.ObjectTypeEnum, _
Optional lngObjID As opgObjectID)
Dim catDB As ADOX.Catalog
Dim lngCurrentRights As Long
Dim varObjectID As Variant
' If lngObjID was specified, call SetObjID procedure to set
' varObjectID to the corresponding Access object ID constant.
If lngObjID > 0 Then
varObjectID = SetObjID(lngObjID)
End If
Set catDB = New ADOX.Catalog
With catDB
' Open Catalog object by using connection to current database.
.ActiveConnection = CurrentProject.Connection
' Retrieve the current set of permissions for the group.
lngCurrentRights = .Users(strUser).GetPermissions(varObjName, lngObjectType, _
varObjectID)
End With
' If varObjName is not Null, then caller is
' checking permissions for a specific object.
If Not IsNull(varObjName) Then
' Check to see if lngCurrentRights is exactly
' adRightNone or adRightFull.
If lngCurrentRights = adRightNone Then
Debug.Print strUser & " has no permissions for " & varObjName
ElseIf lngCurrentRights = adRightFull Then
Debug.Print strUser & " has full permissions for " & varObjName
' Otherwise, use And operator to check if lngCheckRights
' is part of the current permissions bitmask.
ElseIf (lngCurrentRights And lngCheckRights) > 0 Then
Debug.Print strUser & " has the specified permissions for " & varObjName
' User doesn't have the specified permissions.
Else
Debug.Print strUser & " doesn't have the specified permissions for " _
& varObjName
End If
' Otherwise, the varObjName object variable is Null, so the caller
' is checking permissions for new objects of the specified object
' type (in DAO, a Container object).
Else
If lngCurrentRights = adRightNone Then
Debug.Print strUser & " has no permissions for all new objects of " _
& "the specified type."
ElseIf lngCurrentRights = adRightFull Then
Debug.Print strUser & " has full permissions for all new objects of " _
& "the specified type."
ElseIf (lngCurrentRights And lngCheckRights) > 0 Then
Debug.Print strUser & " has the specified permissions for all new " _
& "objects of the specified type."
Else
Debug.Print strUser & " doesn't have the specified permissions for " _
& "all new objects of the specified type."
End If
End If
' Display current permissions in the Immediate window.
Debug.Print DecodePerms(lngCurrentRights)
Set catDB = Nothing
End Sub Best Regards
---
JoaoTL
mail@jtl.co.pt
My MS Access Site: