I copied a database and am making changes to several things within the copied DB. One of the things I am doing is removing the right click option. I am using the following code:
START OF CODE
Public Function doRightClick()
Dim obj As Object
Dim frm As Form
For Each obj In DBEngine.Workspaces(0).Databases(0).Containers("Forms").Documents
DoCmd.OpenForm obj.Name, acHidden
For Each frm In Forms
frm.ShortcutMenu = False
Next
DoCmd.Close acForm, obj.Name, acSaveYes
Next
End Function
END OF CODE
I can run this and it works. But, when I close the database I get the message "Cannot update. Database or object is read-only." I never did anything to make it read-only and I cannot find any setting in the database that makes it read-only. Does anyone have an idea why this is happening and how can I get rid of the read-only?
Thank you.
START OF CODE
Public Function doRightClick()
Dim obj As Object
Dim frm As Form
For Each obj In DBEngine.Workspaces(0).Databases(0).Containers("Forms").Documents
DoCmd.OpenForm obj.Name, acHidden
For Each frm In Forms
frm.ShortcutMenu = False
Next
DoCmd.Close acForm, obj.Name, acSaveYes
Next
End Function
END OF CODE
I can run this and it works. But, when I close the database I get the message "Cannot update. Database or object is read-only." I never did anything to make it read-only and I cannot find any setting in the database that makes it read-only. Does anyone have an idea why this is happening and how can I get rid of the read-only?
Thank you.