Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-28-2018, 03:08 AM   #1
Learn2010
Newly Registered User
 
Join Date: Sep 2010
Posts: 404
Thanks: 92
Thanked 0 Times in 0 Posts
Learn2010 is on a distinguished road
Remove Read-Only

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("Fo rms").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.

Learn2010 is offline   Reply With Quote
Old 09-28-2018, 03:17 AM   #2
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,851
Thanks: 36
Thanked 564 Times in 533 Posts
MajP has a spectacular aura about MajP has a spectacular aura about
Re: Remove Read-Only

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.
MajP is online now   Reply With Quote
The Following User Says Thank You to MajP For This Useful Post:
Learn2010 (09-28-2018)
Old 09-28-2018, 03:19 AM   #3
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,029
Thanks: 115
Thanked 3,017 Times in 2,744 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Remove Read-Only

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

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


I know that you know that we both know nothing
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Learn2010 (09-28-2018)
Old 09-28-2018, 03:45 AM   #4
Learn2010
Newly Registered User
 
Join Date: Sep 2010
Posts: 404
Thanks: 92
Thanked 0 Times in 0 Posts
Learn2010 is on a distinguished road
Re: Remove Read-Only

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.
Learn2010 is offline   Reply With Quote
Old 09-28-2018, 03:55 PM   #5
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,263
Thanks: 15
Thanked 1,593 Times in 1,513 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Remove Read-Only

The code modifies form objects and saves them. You can only do this if you have exclusive control over the database and once you do it, everyone else will be locked out because you have modified objects.

Multiple users can only update shared data. Access no longer supports concurrent object updates by multiple users. Period. I believe that even the source code add in that used to allow this functionality is no longer available.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Record(s) can't be read; no read permission on msysmodule BukHix Modules & VBA 5 04-19-2012 05:19 PM
Remove commas from table, remove " from CSV output BenH Modules & VBA 3 10-11-2010 04:00 AM
Remove read only from subform CTQE Forms 3 07-28-2008 04:31 AM
Remove option to open file as read only Repent Excel 6 04-10-2008 11:37 AM
Remove Excel File Read Only Status DALIEN51 General 1 04-03-2006 05:00 AM




All times are GMT -8. The time now is 02:48 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World