ACC2: Subform's DefaultEditing Can't Be Changed to Allow EditsID: Q132103
|
Moderate: Requires basic macro, coding, and interoperability skills.
If you have a main form that includes a subform, and you set the main
form's DefaultEditing property to Read Only, the subform remains read-only
and ignores any attempts to change it to Allow Edits as long as the main
form is in Form view.
When you want to protect a form record's information, you can set the
form's DefaultEditing property to Read Only. If you need to be able to
change this property while the form is in Form view, you can add a command
button to your form that resets the DefaultEditing property to Allow Edits.
However, if your form contains a subform, the subform will not allow any
user input even when you explicitly change the DefaultEditing property of
the subform to Allow Edits.
Set the main form's DefaultEditing property to Allow Edits, and add a macro or Access Basic code to the Open or Load event so that it changes the DefaultEditing property to Read Only.
This behavior no longer occurs in Microsoft Access version 7.0.
Macro Name Macro Actions
-----------------------------
mcrAllowEdits SetValue
SetValue
mcrAllowEdits Actions
----------------------------------------------
SetValue
Item: DefaultEditing
Expression: 2
SetValue
Item: MyProductsSubform.Form.DefaultEditing
Expression: 2
Macro Name Macro Actions
----------------------------
mcrReadOnly SetValue
SetValue
mcrReadOnly Actions
----------------------------------------------
SetValue
Item: DefaultEditing
Expression: 3
SetValue
Item: MyProductsSubform.Form.DefaultEditing
Expression: 3
For more information about the DefaultEditing property, search for
"AllowEditing," and then "AllowEditing, DefaultEditing Properties" using
the Microsoft Access Help menu.
For more information about macros see the Microsoft Access "User's Guide",
version 2, Chapter 24 and 25, "Macro Basics" and "Using Macros with Forms,"
pages 605-664.
Keywords : kbusage FmsSubf
Version : 2.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 29, 1999