D
Dave Elliott
I cant seem to make my code refer to the sub-from to check for Nulls. The
main form name is FPayments and the sub-form's name is FPaymentSub.
Alternatively can I put a control ('s) on main form that refers to sub-from
and use it to check for nulls on the sub-form ?
i.e. The controls on the sub-from that I want to check are Payment
(This is where a payment is made) You should not be able to pay this Invoice
without a payment being made of course, hence the If IsNull statement.
Also on the sub-form is a control named PayType which is used for
payment type, i.e. Check, Cash, etc...
If this payment type is Check then I want the next control which is named
CheckNo to have a value in it, like check number.
IF all these conditions are met, then the Invoice can be saved.
I was thinking of adding TextBoxes to the main form which are bound to the
sub-form (Payment,PayType,CheckNo) and then use them for the If IsNull
condition. The Text Box to mark as paid these Invoices is on the main form,
not the sub-form.
Any Suggestions ? Thanks, Dave
P.S. Tried using this Code, but with no luck on the OnClick Event TexBox on
the main form.
If IsNull(Payment) Then
MsgBox "Need PaymentType"
Cancel = True
ElseIf PayType = "Check" And IsNull(CheckNo) Then
MsgBox "Need check number"
Cancel = True
End If
main form name is FPayments and the sub-form's name is FPaymentSub.
Alternatively can I put a control ('s) on main form that refers to sub-from
and use it to check for nulls on the sub-form ?
i.e. The controls on the sub-from that I want to check are Payment
(This is where a payment is made) You should not be able to pay this Invoice
without a payment being made of course, hence the If IsNull statement.
Also on the sub-form is a control named PayType which is used for
payment type, i.e. Check, Cash, etc...
If this payment type is Check then I want the next control which is named
CheckNo to have a value in it, like check number.
IF all these conditions are met, then the Invoice can be saved.
I was thinking of adding TextBoxes to the main form which are bound to the
sub-form (Payment,PayType,CheckNo) and then use them for the If IsNull
condition. The Text Box to mark as paid these Invoices is on the main form,
not the sub-form.
Any Suggestions ? Thanks, Dave
P.S. Tried using this Code, but with no luck on the OnClick Event TexBox on
the main form.
If IsNull(Payment) Then
MsgBox "Need PaymentType"
Cancel = True
ElseIf PayType = "Check" And IsNull(CheckNo) Then
MsgBox "Need check number"
Cancel = True
End If