Y
Yukon
BACKGROUND:
1) Form (with subform) does not allow edits in order to safeguard data
from unintentional updates.
Form Properties - Allow Edits - No
2) "Edit Record" Command Button created to allow deliberate changes.
Event - On Click
Me.AllowEdits = True
3) After changes are made, "Save Record" Command Button created to set
form back to Condition 1 above
Event - On Click
Me.AllowEdits = False
4) If the "Save Record" Command Button is not used in Condition 3
above, AfterUpdate Event at form level is set to
AllowEdits = False (to force return to Condition 1 above)
PROBLEM:
When editing data in a record, I sometimes want to update fields in
the subform in addition to the main form.
Condition 4 above returns the subform to "No Edits" when switching
from the mainform to the subform (either by tab or mouse click).
THE VBA CODE:
Private Sub Form_AfterUpdate()
Me.AllowEdits = False ' Return the form to its read-only
state.
MsgBox "Record Saved"
End Sub
QUESTION:
How can I code this to allow edits to the subform before access sets
the entire form to "No Edits"?
Thanks.
1) Form (with subform) does not allow edits in order to safeguard data
from unintentional updates.
Form Properties - Allow Edits - No
2) "Edit Record" Command Button created to allow deliberate changes.
Event - On Click
Me.AllowEdits = True
3) After changes are made, "Save Record" Command Button created to set
form back to Condition 1 above
Event - On Click
Me.AllowEdits = False
4) If the "Save Record" Command Button is not used in Condition 3
above, AfterUpdate Event at form level is set to
AllowEdits = False (to force return to Condition 1 above)
PROBLEM:
When editing data in a record, I sometimes want to update fields in
the subform in addition to the main form.
Condition 4 above returns the subform to "No Edits" when switching
from the mainform to the subform (either by tab or mouse click).
THE VBA CODE:
Private Sub Form_AfterUpdate()
Me.AllowEdits = False ' Return the form to its read-only
state.
MsgBox "Record Saved"
End Sub
QUESTION:
How can I code this to allow edits to the subform before access sets
the entire form to "No Edits"?
Thanks.