View Single Post
  #1  
Old May 30th, 2004, 05:43 AM
Sandra
external usenet poster
 
Posts: n/a
Default Restricting edits in form with subforms

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