?
Solved

Access Form Allows Editing with AllowEdits set to False

Posted on 1998-09-02
8
Medium Priority
?
674 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
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
LVL 5

Accepted Solution

by:
kulikuli earned 200 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

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

840 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