Thanks in advance for all you assistance.



I have a Form frm_NewOrderEntry2 with 3 tab controls tab_OrderDetails, tab_Payments and tab_Delivery.

On tab_Payments I have a Subform sfrm_Payments which has 3 fields relevant to my validation.

1. txt_PaymentTotal has a Control Source of =Sum(Nz([PaymentAmount],0)*1) where Payment Amount is a Number
2. txt_OrderTotal has a Control Source of =[Forms]![frm_NewOrderEntry2]![sfrm_NewOrderDetails].[Form]![txtOrderTotal] which gets a similar Sum off the Order Details Table
3. txt_AmountOwing has a Control Source of ==[txtOrderTotal]-[txtPaymentTotal]

I have a button cmd_Delivery that I need to check and see if txt_Amount Owning is Less then Or Equal to 0 (To ensure the balance Owing is collected.)

If True I want to enable tab_Delivery and SetFocus to it and disable tab_Payments.

If False I want a text Box that Alerts that money is still owing.

In the OnClick Event I have tried:

Private Sub cmdDelivery_Click()

If txt_AmountOwning <= 0 Then
Forms!frm_NewOrderEntry2!tabDelivery.Enabled = True
Forms!frm_NewOrderEntry2!tabDelivery.SetFocus
Forms!frm_NewOrderEntry2!tabPayments.Enabled = False


Else

MsgBox ("There Is Still Money Owing On This Order")
End If

End Sub

I am obviously missing something as it always goes to the new form.

Please help !

Jason