Referencing a second subform in a calculated field

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
 
G

Guest

Thanks Jeff! It's working. Any ideas on the flickering (I mean it's some
major flickering!)
 
J

Jeff L

I believe it's the Me.Recalc. In looking at your code, I can't really
see a need for it. Delete it and see if that takes care of your
flickering problem.
 

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