Restricting edits in form with subforms

  • Thread starter Thread starter Sandra
  • Start date Start date
S

Sandra

I have a tabbed form based on master table DONORS. The
first page is for entering the master record in DONORS.
I have a subform on the next tab page that links to a
table RELATIONS. When the main form is opened AllowEdits
and AllowDeletions set to NO to prevent "misedits" when
using Find. I have an EDIT command button on the form
which sets AllowEdits and AllowDeletions to YES.

The Event Procedure for the EDIT button is as follows:
Private Sub EditRecord_Click()
On Error GoTo Err_EditRecord_Click
Me.Detail.BackColor = 255
Me.AllowEdits = True

Exit_EditRecord_Click:
Exit Sub

Err_EditRecord_Click:
MsgBox Err.Description
Resume Exit_EditRecord_Click

End Sub

Then, in the AfterUpdate:
Private Sub Form_AfterUpdate()
Me.AllowEdits = False
Me.AllowDeletions = False
Me.Detail.BackColor = 12615680
End Sub

This works fine for the DONORS main form, but doesn't
make the switch from NO to YES in the linked subform for
RELATIONS on the other tabbed page, even though the
normal open mode for this subform is YES.

What am I doing wrong?

Thanks,
Sandra
 
Sandra,

I think you will need to manage these properties of the subform
separately, for example...
Me.Relations.Form.AllowEdits = True
 
Back
Top