If Statement For Sub-Form

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
 
S

StCyrM

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.
 

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