Hi and thanks in advance,
I am using Access 2003 and have some unbound textboxes formatted as percent with zero decimal places. I have code for each textbox in the After Update event which divides the textbox value by 100 so that the correct values are displayed to the user. So if the user enters 100 then they see 100% rather than 10000%.
The strange thing is that for certain numbers the underlying decimal value is displayed when I click back in the textbox. For instance, if I enter 70 then 70% is displayed as required but when I click back in the textbox the 70% changes to display the underlying value of 0.7. This behaviour only happens with 10 numbers out of the range: 1 to 100. The numbers are: 35, 41, 47, 57, 69, 70, 82, 83, 94, 95. All the other numbers in the range remain as the number followed by the percent sign when I click back into the textbox.
As I will be saving the underlying fractions to a table, I don't want values displaying and rounding like this. For instance, if I enter 70 and then click back on the textbox then the 70% will change to 0.7. I can then edit that value to something like 1.5 which will then round and display as 2% when the textbox loses focus. If I then click back on the text box, the underlying value displays as 1.5% which rounds up to 2% due to the textbox being formatted with zero decimal places. Unfortunately, the underlying value of 0.015 will be saved rather than 0.02 which actually equates to what is displayed in the textbox.
Any ideas on what I can do to control this behaviour?
Regards
Michael