Remove Read-Only

Learn2010

Registered User.
Local time
Today, 05:45
Joined
Sep 15, 2010
Messages
415
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.
 
Is it read only in Explorer properties? Any chance you copied onto a cd or hardrive and back? I have an unencrypted external drive and anything moved off of there ends up being read only. However, normally you would see a message at startup.
 
I can't see why that code would make it read only.
However I think it you should move the first 'Next' after the DoCmd line.

It would also help if you indented your code and used the code tags button (#) on the post thread window

EDIT
You can also disable default shortcut menus in Access options. No code needed
 
It is not read-only in the properties. I copied it from one folder to another.

I disabled the shortcut menus and it got rid of the right click option.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom