Solved

Access Form Allows Editing with AllowEdits set to False

Posted on 1998-09-02
8
607 Views
Last Modified: 2009-12-16
I am having what appears to be mysterious, and inconsistent behavior in one form in a database that has several other forms that are not exhibiting the same behavior.
 
The problem is related to the AllowEdits property of the form.  It is set to No, and I also set Me.AllowEdits = False within code behind the form.  All the other forms within the application use the same logic and do not allow editing.  Yet the problem form allows edits at anytime, even when started directly from the database/forms window. As a further clue, this problem form also allows records to be deleted with no warning dialog - all other forms and tables respond with the verify delete dialog.
0
Comment
Question by:griggscl
8 Comments
 
LVL 1

Expert Comment

by:LostSoul
ID: 1961081
What kind of a form is it that allows the edits?  Is it by chance a form that contains a sub-form?
0
 

Expert Comment

by:Decorules
ID: 1961082
Have you tried running Repair Database on this database. It might help and then compress the database.

The other option is to set the record type in the trouble form to snapshot not dynaset. (thats if you want to just view the data). You should be still able to Delete records in the sub forms.
0
 

Author Comment

by:griggscl
ID: 1961083
Good comments, but not the problem as I had already repaired & compacted.  The dynaset also is a good idea, except I do allow users to edit from this form under certain conditions.

LostSoul - yes, the form has a subform attached.  Also, the data base is split, and the backend is replicated to one other remote location.


0
 
LVL 5

Accepted Solution

by:
kulikuli earned 100 total points
ID: 1961084
Open your recordsource as a query. Try editing it. You probably can't. So now you probably will know where the problem is.I hope :)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 5

Expert Comment

by:kulikuli
ID: 1961085
Sorry. The above answer is incorrect. I misunderstood the question. A new attempt: Your form probably is not a bound form (it has no recordsource, or the controls you are trying to edit don't have a recordsource. Allowedits is only valid for bound controls. Hope this helps
0
 
LVL 1

Expert Comment

by:ljb
ID: 1961086
I have had similar problems (Access 2) with forms which have subforms.  If I tried to make the form read only programatically, i.e. depending on the menu choice made by the user, I could never seem to make the subform readonly.  The main form would sometimes be and i did not seem to be able to make it behave dependably all the time.  I resorted to some code found in the Access Developers magazine which loops through all your controls and toggles between read only and updatable.  If you like I can supply the code?  This works reliably for me - now in 97 too.
0
 
LVL 1

Expert Comment

by:LostSoul
ID: 1961087
Either I'm misunderstanding your problem or you aren't expressing it properly, anyway...

I assume the edits you want to disallow are on the subform as opposed to the main form.  If this is the case, you have to open up the subform in design view (double click on it while the main form is in design view) and set the subform to allow edits - no.  Programatically:

forms![MainFormName]![SubFormName].form.allowedits=false
or if setting it from the main form
me![SubFormName].form.allowedits=false

You won't have to loop through all the controls and set their properties individually as suggested above by ljb as I've never seen such a problem before in Access 97.

You aren't giving enough details in your question.  All of the answers you have been given so far are based on assumptions made by the people giving them to you.

0
 

Expert Comment

by:paulvb
ID: 3246475
Has anyone answered this question yet I am having the same problem, I have forms that are set to AllowEdits = False, and work fine. I have one form set to AllowEdits = False that will allow edits. After testing the form it allows edits until the Esc key is hit twice. Any suggestions to this?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now