Hello Everyone,
I have an ergent issue with a totals column whereby the following occurs:
When my script perform a tally using currencies then placing a subtracted amount in a separate column, it produces inconsistent results.
Please refer to the attached image:
1. when my script tallies .79 it rounds to .80 (how to stop that?)
2. when whole numbers are entered, .80 appears out of no where (how to correct that?)
3. This in turn presents an incorrect total
Also, this is another example along the same lines of the issue at hand with code:
I have a Total charge field = $100.50
and i am looking to subtract = $50.50
And present the remaining total in field Surplus = $50.00
unfortunately the following code I have running is returning $100.50; $50.50 and $50.50 respectively. How do I stop the $.50 from carrying over?
Thanks in advance for your patience and assistance in this matter
Regards,
A.....
I have an ergent issue with a totals column whereby the following occurs:
When my script perform a tally using currencies then placing a subtracted amount in a separate column, it produces inconsistent results.
Please refer to the attached image:
1. when my script tallies .79 it rounds to .80 (how to stop that?)
2. when whole numbers are entered, .80 appears out of no where (how to correct that?)
3. This in turn presents an incorrect total
Also, this is another example along the same lines of the issue at hand with code:
I have a Total charge field = $100.50
and i am looking to subtract = $50.50
And present the remaining total in field Surplus = $50.00
unfortunately the following code I have running is returning $100.50; $50.50 and $50.50 respectively. How do I stop the $.50 from carrying over?
Code:
Dim lngTotalCharge As Long
Dim sngECH As Long
If ECH.Text = "" Then
sngECH = 0
Else
sngECH = CSng(ECH.Text)
End If
'delay
TotalCharge.SetFocus
Dim curTotalCharge As Currency
Dim strTotalCharge1 As String
strTotalCharge1 = TotalCharge.Text
If strTotalCharge1 = "" Then
delay
End If
If strTotalCharge1 = "" Then
' delay
End If
If strTotalCharge1 = "" Then
' delay
End If
If strTotalCharge1 = "" Then
'delay
End If
If strTotalCharge1 = "" Then
' delay
End If
If strTotalCharge1 = "" Then
' delay
End If
If strTotalCharge1 = "" Then
' delay
End If
curTotalCharge = CCur(strTotalCharge1)
txtPhysicians.SetFocus
txtPhysicians.Text = CStr(curTotalCharge - sngECH)
Else
txtPhysicians.SetFocus
txtPhysicians.Text = ""
ECH.SetFocus
ECH.Text = ""
TotalCharge.SetFocus
TotalCharge.Text = ""
End If
Thanks in advance for your patience and assistance in this matter
Regards,
A.....
Attachments
Last edited: