C
cjg.groups
Hello,
When I try to call a subroutine on one subform from the parent form, I
get the error "Object doesn't support this property of method." Access
2003 is being used. Any suggestions would be appreciated.
The subroutine enables some controls on subform PaymentSubForm.
Changes to a control on the parent, OrderForm, should also enable those
subform controls. PaymentSubForm is open as a tab control within
OrderForm. The code is below.
Maybe it fails because the subform subroutine checks the parent form
control whose AfterUpdate is calling the subroutine..... Maybe I'm
just calling it wrong; I've seen four different methods in other
Newsgroup posts. In ToggleEnabled(), I even intentionally replaced Me
with the fully qualified form name since it only ever modifies that
form (but was that necessary?).
I know I should move ToggleEnabled to a module, but it seems more
organized to keep it with the form it modifies.
OrderForm:
Private Sub PaymentCheck_AfterUpdate()
Forms!OrderForm!PaymentSubForm.ToggleEnabled
End Sub
PaymentSubForm:
Public Sub ToggleEnabled()
conPaymentOK = "01 02 05"
Dim boolDidPay As Boolean
If IsNull(Forms!OrderForm!PaymentCheck) Then
boolDidPay = True
Else
boolDidPay = InStr(1, conPaymentOK,
CStr(Forms!OrderForm!PaymentCheck)) > 0
End If
Forms!OrderForm!PaymentSubForm!PayDate.Enabled = boolDidPay
Forms!OrderForm!PaymentSubForm!PayAmount.Enabled = boolDidPay
Forms!OrderForm!PaymentSubForm!PayCheckNo.Enabled = boolDidPay
End Sub
Thank you for your help.
When I try to call a subroutine on one subform from the parent form, I
get the error "Object doesn't support this property of method." Access
2003 is being used. Any suggestions would be appreciated.
The subroutine enables some controls on subform PaymentSubForm.
Changes to a control on the parent, OrderForm, should also enable those
subform controls. PaymentSubForm is open as a tab control within
OrderForm. The code is below.
Maybe it fails because the subform subroutine checks the parent form
control whose AfterUpdate is calling the subroutine..... Maybe I'm
just calling it wrong; I've seen four different methods in other
Newsgroup posts. In ToggleEnabled(), I even intentionally replaced Me
with the fully qualified form name since it only ever modifies that
form (but was that necessary?).
I know I should move ToggleEnabled to a module, but it seems more
organized to keep it with the form it modifies.
OrderForm:
Private Sub PaymentCheck_AfterUpdate()
Forms!OrderForm!PaymentSubForm.ToggleEnabled
End Sub
PaymentSubForm:
Public Sub ToggleEnabled()
conPaymentOK = "01 02 05"
Dim boolDidPay As Boolean
If IsNull(Forms!OrderForm!PaymentCheck) Then
boolDidPay = True
Else
boolDidPay = InStr(1, conPaymentOK,
CStr(Forms!OrderForm!PaymentCheck)) > 0
End If
Forms!OrderForm!PaymentSubForm!PayDate.Enabled = boolDidPay
Forms!OrderForm!PaymentSubForm!PayAmount.Enabled = boolDidPay
Forms!OrderForm!PaymentSubForm!PayCheckNo.Enabled = boolDidPay
End Sub
Thank you for your help.