this seemed to be working fine...but i came across this:
dim itemtotal, headertotal as double
headertotal = 90.11
itemtotal = 65.04
txtitemcost.text = 25.07
it goes to the msgbox, I thought it may of been a rounding issue but I inserted another purchase using the same decimals
headertotal = 50.11
itemtotal = 25.04
txtitemcost.text = 25.07...that worked fine..am I missing something here?
VB Code:
If (itemTotal + CDbl(txtItemCost.Text)) > headerTotal Then amountneeded = (headerTotal - itemTotal) MsgBox("Item total is greater than Receipt amount" & vbCrLf & vbCrLf & "Receipt Total: $" & headerTotal & vbCrLf & "Item Total: $" & itemTotal & vbCrLf & vbCrLf & "Amounted needed to balance: $" & amountneeded, MsgBoxStyle.Information, "PCMS ") Exit Sub End If




Reply With Quote