G
Guest
I have a form with two subforms. I have code to populate boolean fields which
works fine as a form_current event. However, I need it to recalculate when a
Net Acres field is changed on my main form.
On my first subform, there is a calculated field whose value will change
when the net_acres field changes. So I set up a recalc on the got_focus event
of that field. After the recalc, I also want to re-test for the values of the
boolean fields (they reside on the main form). Part of the test refers to a
control called invoice number on a 2nd subform.
I can't find how to reference the field on the second subform. Here's what
I've tried:
Private Sub Balance_GotFocus()
Me.Recalc
If Me.Balance < 0 Then
Forms!frmREDLINES.Addl_Pay = True
Else: Forms!frmREDLINES.Addl_Pay = False
End If
If IsNull(Me.Parent.frmREDLINES!qryLPR_Invoices_subform.Form!Invoice_No)
= False And Me.Balance < 0 Then
Forms!frmREDLINES.Addl_Billing = True
Else: Forms!frmREDLINES.Addl_Billing = False
End If
The error comes on the If IsNull ... line. Thanks
Plus, if you can help me with that, I bet you can answer this - during the
recalc my screen flickers. Can I manipulate a property to prevent that?
Thanks
works fine as a form_current event. However, I need it to recalculate when a
Net Acres field is changed on my main form.
On my first subform, there is a calculated field whose value will change
when the net_acres field changes. So I set up a recalc on the got_focus event
of that field. After the recalc, I also want to re-test for the values of the
boolean fields (they reside on the main form). Part of the test refers to a
control called invoice number on a 2nd subform.
I can't find how to reference the field on the second subform. Here's what
I've tried:
Private Sub Balance_GotFocus()
Me.Recalc
If Me.Balance < 0 Then
Forms!frmREDLINES.Addl_Pay = True
Else: Forms!frmREDLINES.Addl_Pay = False
End If
If IsNull(Me.Parent.frmREDLINES!qryLPR_Invoices_subform.Form!Invoice_No)
= False And Me.Balance < 0 Then
Forms!frmREDLINES.Addl_Billing = True
Else: Forms!frmREDLINES.Addl_Billing = False
End If
The error comes on the If IsNull ... line. Thanks
Plus, if you can help me with that, I bet you can answer this - during the
recalc my screen flickers. Can I manipulate a property to prevent that?
Thanks