M
Maury Markowitz
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
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