Thanks for your reply. I am not trying to specifically
grant permissions to it. Here is what I am using:
Function Grant_FullAccess()
On Error GoTo Err_GrantPermissions
Dim DB As DAO.Database, i As Integer, J As Integer, G
As Group
Set DB = DBEngine(0)(0)
msg = "Enter the Name Group to Grant
Permissions:" 'Enter the group's name
Title = "Grant Group Full Permissions"
groupname = InputBox(msg, Title)
MsgBox "This process will take a few minutes." & Chr
(13) & Chr(10) & "Click OK and wait until you see the
Summary Message.", 48, "Grant a Group Permissions to the
Database"
DoCmd.Hourglass True
ReturnValue = SysCmd
(SYSCMD_INITMETER, "Updating... ", 7)
For i = 0 To DB.Containers.Count - 1
For J = 0 To DB.Containers
(i).Documents.Count - 1
ReturnValue = SysCmd(SYSCMD_UPDATEMETER,
i)
DB.Containers(i).Documents(J).UserName =
groupname
DB.Containers(i).Documents(J).Permissions
= dbSecReplaceData Or dbSecRetrieveData Or
dbSecReplaceData Or dbSecInsertData Or
DB_SEC_FRMRPT_EXECUTE Or DB_SEC_MAC_EXECUTE Or
dbSecDBOpen Or dbSecDeleteData
Next J
Next i
ReturnValue = SysCmd(SYSCMD_REMOVEMETER)
DoCmd.Hourglass False
MsgBox "You have given Full Permissions for Tables,
Querys, Forms, Reports & Macros (Except to administer
permissions to other groups) to " & " " & groupname,
64, "Grant Group Full Permissions Complete"
Exit_Err_GrantPermissions:
Exit Function
Err_GrantPermissions:
DoCmd.Hourglass False
ReturnValue = SysCmd(SYSCMD_REMOVEMETER)
Call LogError("Grant Full Access
Error", "Grant_FullAccess()", Err.Description,
Err.Number, Now)
MsgBox "Group name " & "<" & groupname & ">" & " is
not correct. The name is either misspelled or does not
exist in the security module.", 48, "Invalid Group Name"
Resume Exit_Err_GrantPermissions
End Function
This is the message that I receive:
"An error has occured. Please notify your database
administrator.
You do not have the necessary permissions to use
the 'AccessLayout' object. Have your system
administrator or the person who created this object
establish the appropriate permissions for you."