October 23rd, 2012 08:17 PM
Trap for Young (and Old) Players - (Text Box Formatting Trap)
I cant believe I have never come across this problem before (Its now about 14 years working with VB6 on a daily basis)
I tested software on my machine - worked well !
Ran on the customer machine and kept getting strange results
Finally tracked it to this statement
Here is the problem
ValIncTax = Val(txtInvValue.text)
ValIncTax is a Currency Type
txtInvValue.text is a Text Box
The Text Box had the value formatted as ##,###,##0.00
What was being transferred to ValIncTax was just the 3 ! (The rest was truncated off)
Worked on my machine because I was using figures no larger than 999.99
So there's one for the books !
Click Here to Expand Forum to Full Width