If Statement For Sub-Form

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

My main form is named Timecards and this is where I want the code to be run
from on the current event.
The sub-form on the main form is named FPaymentSub and in the form footer
there is a Label named Label20
Label20 shows up when a Invoice has been overpaid.
Tried the below code, but it does not refer to the sub-form correctly.
What do I need to change?

If Forms!Timecards!FPaymentSub!(Balance) < 0 Then
Label20.Visible = True
MsgBox "Credit Invoice is Needed, Customer Has Overpaid"
Else: Label20.Visible = False
End If
 
Good morning David

The general statement for referencing forms and controls in a Main Form / Sub
Form configuration is as follows:

Forms!MyMainForm!MySubForm.Form!MyControlOnSubForm

Hope this helps

Best Regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
Back
Top