One way that you could do it, is to code the function, and run it when the text box loses focus. The problem here is that if you click on the textbox, and then leave it again, it could rerun the function, so you would need to put some code in place to prevent this.
If you have a textbox called txtValue, go to the properties, and click the On LostFocus Event. A button will appear with ... on it. Click on that, choose Code builder, and you will be given something like...
Code:
Private Sub txtValue_LostFocus()
End Sub
Between those two line you would enter the following...
Code:
dim dblValue as double
if isnumeric(txtValue.text) then
dblValue = val(txtValue.text)
if dblValue > 0.1 then
dblValue = dblValue * 0.001
txtValue.text = dblValue
end if
else
msgBox "Not a numeric value!"
end if
That should be fairly straight forward, although it may need a little tweaking, and you could take out the check for the numeric value if you need to. Let me know if need any additional explanation.
Mike
Mike
EchoVue.com