I have a form which can be in three states: AllowEdits false or true while AllowAdditions is false, or the third state of AllowAdditions is true.
There is a button on the form which enables the user to change the state of the form from AllowEdits false to AllowEdits true and back. The label on the button changes back and forth from Allow Edits to View Data.
The form opens in the allow additions mode and this button's label starts as "View Data". When clicked, after checking if the user wants to save the new record, the form is set to the AllowEdits false state and the background color changes from green (add mode) to grey (view mode). The button now says "Allow Edits" and, when clicked, the color changes to yellow and AllowEdits state changes to true. So far, so good. However, when the user clicks the button again, AllowEdits is set to false (I confirmed this with various test messages) and the background changes to grey. The background color of grey or yellow is set based on the status of AllowEdits. There is only one place in the code where AllowEdits is set to true.
However, when the user returns to the view data state, the header data on the form can still be changed. I've tested everything I can think of and can't find anyplace in the code (or elsewhere) that would allow editing the data even while the form is set to AllowEdits as false. And the form status is changed correctly the first time, but not after.
Is this an Access quirk or is there something else I need to look at?
Bob
There is a button on the form which enables the user to change the state of the form from AllowEdits false to AllowEdits true and back. The label on the button changes back and forth from Allow Edits to View Data.
The form opens in the allow additions mode and this button's label starts as "View Data". When clicked, after checking if the user wants to save the new record, the form is set to the AllowEdits false state and the background color changes from green (add mode) to grey (view mode). The button now says "Allow Edits" and, when clicked, the color changes to yellow and AllowEdits state changes to true. So far, so good. However, when the user clicks the button again, AllowEdits is set to false (I confirmed this with various test messages) and the background changes to grey. The background color of grey or yellow is set based on the status of AllowEdits. There is only one place in the code where AllowEdits is set to true.
However, when the user returns to the view data state, the header data on the form can still be changed. I've tested everything I can think of and can't find anyplace in the code (or elsewhere) that would allow editing the data even while the form is set to AllowEdits as false. And the form status is changed correctly the first time, but not after.
Is this an Access quirk or is there something else I need to look at?
Bob