Good point about the form/report permissions not being imported with the object. Recording the permissions of all users and groups for a new object in the developement database (again using the same mdw file) isn't too difficult:
Declare these at module level:
Public Const JET_SECURITY_FORMS = "{c49c842e-9dcb-11d1-9f0a-00c04fc2c2e0}"
Public Const JET_SECURITY_MACROS = "{c49c842f-9dcb-11d1-9f0a-00c04fc2c2e0}"
Public Const JET_SECURITY_REPORTS = "{c49c8430-9dcb-11d1-9f0a-00c04fc2c2e0}"
Dim catCurrent As ADOX.Catalog
Dim grpCurrent As ADOX.Group
Dim usrCurrent As ADOX.User
Dim strObject As String
Dim lngObjectType As Long
Dim lngRight as Long
strObject = "NewForm"
lngObjectType = JET_SECURITY_FORMS
Set catCurrent = New ADOX.Catalog
Set catCurrent.ActiveConnection = CurrentProject.Connection
For Each usrCurrent In catCurrent.Users
lngRight= usrCurrent.GetPermissions(strObject,
adPermObjProviderSpecific, lngObjectType)
'Record lngRight for User and Object
Next usrCurrent
For Each grpCurrent In catCurrent.Groups
lngRight = grpCurrent.GetPermissions(strObject, adPermObjProviderSpecific, lngObjectType)
'Record lngRight for Group and Object
Next grpCurrent
Then update like this:
Dim cnnCurrent As ADODB.Connection
Dim catCurrent As ADOX.Catalog
Dim grpCurrent As ADOX.Group
Dim usrCurrent As ADOX.User
Dim strFrontEnd As String
Dim strForm As String
Set cnnCurrent = New ADODB.Connection
cnnCurrent.Open "Data Source='FrontEnd.mdb'; jet oledb:system database='Application.mdw'; User ID='You'; Password='Your Password'"
End With
strForm = "NewForm"
lngObjectType = JET_SECURITY_FORMS
Set catCurrent = New ADOX.Catalog
Set catCurrent.ActiveConnection = cnnCurrent
For Each usrCurrent In catCurrent.Users
'Retrieve rights lngRight for User.
usrCurrent.SetPermissions strForm, adPermObjProviderSpecific, adAccessSet, lngRight, , lngObjectType
Next usrCurrent
For Each grpCurrent In catCurrent.Groups
'Retrieve rights lngRight for Group.
grpCurrent.SetPermissions strForm, lngObjectType, adAccessSet, lngRight, , lngObjectType
Next grpCurrent
It's also worth noting that you can trap errors and compare them to a look up table of error messages (you've got to create it yourself but it's available somewhere in the Access Developer's handbook and online at Microsofts web site - again don't have a link sorry). This might save you some work in sussing responses to permission violations.
Have Fun...!