Disabling fields on a subform from the parent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a very complex form that contains a number of subforms in tabs. In
order to centralize the form state control, I have put all of the logic in
the main form. For instance, there is a tab called "fills" that has a
FillsSubform in it, and the logic for setting up its recordsource and editing
state is contained in the outer form, OrderEntry.

I have noticed some odd behavior though. When the parent tells the subform
to disable its controls, this only happens on the first row of the subform.
When the code is in the subform instead, it works fine (at least I think it
did).

Any ideas?

Maury

======

Public Sub SetupFillState()
' enable/disable fields on the subform
FillsSubform.Form.QuantityField.Enabled = canEdit
FillsSubform.Form.PriceField.Enabled = canEdit
FillsSubform.Form.AccruedField.Enabled = canEdit
FillsSubform.Form.FeeField.Enabled = canEdit
FillsSubform.Form.CommissionField.Enabled = canEdit
FillsSubform.Form.NetField.Enabled = canEdit
FillsSubform.Form.BrokerCombo.Enabled = canEdit
FillsSubform.Form.IsManualCheck.Enabled = canEdit

' focus somewhere
If canEdit And Nzz(FillsSubform!isManual) = 1 Then
FillsSubform.Form.QuantityField.SetFocus
End Sub
 
Maury, you can set the *control* on the main form that contains the subform
to enabled=false and not bother with all the individual controls on the
subform itself.
That might be something you can work with.

UpRider
 
UpRider said:
Maury, you can set the *control* on the main form that contains the subform
to enabled=false and not bother with all the individual controls on the
subform itself.
That might be something you can work with.

I'll give this a try, thanks!
 
Back
Top