Disabling fields on a subform from the parent

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
 
U

UpRider

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
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top