Allow Edit False/Subform

T

TinleyParkILGal

I have 4 or 5 subforms on a form. My form is set to allow edits=false unless
a user clicks Edit Record. The subforms do not inherit this. Is there a way
that the subforms and their data can inherit this? I want the data on the
subforms to operate in the same manner. I would like to just set the subform
properties to allow edits=false and then just have the user click the Edit
Record button on the main form to edit subform data also.
Professionals...thank you in advance.
 
S

Sprinks

Hi, Tina. I think easiest way is to loop through the form controls:

Private Sub cmdPermitEdits_Click()
' Set main form AllowEdits property and other functionality here

' Set all subform controls' Allow Edits property to True
For Each ctl In Me.Controls
If ctl.ControlType = acSubform Then
ctl.AllowEdits = True
End If
Next ctl

End Sub

HTH
By the way, used to wrestle against Tinley Park when I went to HF back in
the day.
Sprinks
 
Top