O
Odewallrus
Here is a problem that I am having that seems very simple to me
obviously I am missing something. If some one could help?
I have a house charge field that allows a user to charge all or
portion of a bill. In the AfterUpdate event of the house_charge fiel
is the following code. The problem is that if I enter a house charg
amount that is equal to the grand total, in most cases I get th
message "A House Charge posted against this work order cannot b
greater than the Grand Total, or left blank." I believe that it has t
do with the totals being rounded up and thus they are actually les
that the house_charge amount. Below I turned on 3 decimal places t
show the problem, but in my database I have set currency and 2 decima
places in all forms, tables and queries. Below I am trying to input
value of $340.21 into the house_charge field.
code:
**************************************************
If Me.House_Charge_Amount.Value <
Forms![Customer_information_Form]![Work_Order_Subform]![Work_Order_Customer_Total_Subform]!Grand_Tota
Then
Me.Other_Payment.SetFocus
Me.House_Charge_Amount.Enabled = False
Me.House_Charge_Amount.Locked = True
Me.Parent.House_Charge_Balance_Subform.Requery
ElseIf MsgBox("A House Charge posted against this work order cannot b
greater than the Grand Total, or left blank.", vbOKOnly, "House Charg
Help") = vbOK Then
Me.House_Charge_Amount = "0"
Me.House_Charge_Amount_Button.SetFocus
Me.House_Charge_Amount.Enabled = False
Me.House_Charge_Amount.Locked = True
End If
Work_Order_Customer_Total_Subform:
***************************************************
(with 2 decimal places set)
Labor $20.95
Parts $300.00
Sub Total $320.95
Tax $19.26
Grand Total $340.21
(with 3 decimal places set)
Labor $20.95
Parts $300.00
Sub Total $320.95
Tax $19.257
Grand Total $340.20
obviously I am missing something. If some one could help?
I have a house charge field that allows a user to charge all or
portion of a bill. In the AfterUpdate event of the house_charge fiel
is the following code. The problem is that if I enter a house charg
amount that is equal to the grand total, in most cases I get th
message "A House Charge posted against this work order cannot b
greater than the Grand Total, or left blank." I believe that it has t
do with the totals being rounded up and thus they are actually les
that the house_charge amount. Below I turned on 3 decimal places t
show the problem, but in my database I have set currency and 2 decima
places in all forms, tables and queries. Below I am trying to input
value of $340.21 into the house_charge field.
code:
**************************************************
If Me.House_Charge_Amount.Value <
Forms![Customer_information_Form]![Work_Order_Subform]![Work_Order_Customer_Total_Subform]!Grand_Tota
Then
Me.Other_Payment.SetFocus
Me.House_Charge_Amount.Enabled = False
Me.House_Charge_Amount.Locked = True
Me.Parent.House_Charge_Balance_Subform.Requery
ElseIf MsgBox("A House Charge posted against this work order cannot b
greater than the Grand Total, or left blank.", vbOKOnly, "House Charg
Help") = vbOK Then
Me.House_Charge_Amount = "0"
Me.House_Charge_Amount_Button.SetFocus
Me.House_Charge_Amount.Enabled = False
Me.House_Charge_Amount.Locked = True
End If
Work_Order_Customer_Total_Subform:
***************************************************
(with 2 decimal places set)
Labor $20.95
Parts $300.00
Sub Total $320.95
Tax $19.26
Grand Total $340.21
(with 3 decimal places set)
Labor $20.95
Parts $300.00
Sub Total $320.95
Tax $19.257
Grand Total $340.20