Solved

Access Form Allows Editing with AllowEdits set to False

Posted on 1998-09-02
8
615 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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
 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

777 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