If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
Restricting edits in form with subforms
Sandra,
I think you will need to manage these properties of the subform separately, for example... Me.Relations.Form.AllowEdits = True -- Steve Schapel, Microsoft Access MVP Sandra wrote: 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 |
Thread Tools | |
Display Modes | |
|
|