View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Up date a value in a text box


I would test the KeyPress event and check that if a decimal period entered
and cancel it if so.

--
__________________________________
HTH

Bob

"JB" wrote in message
...
I have a short validation routine and makes sure input into a text box is a
number. It works fine except, part of the code checks to see if a second
decimal (period) was entered. If the test is true it will delete the
second
period. The code that does that is below:
TestNumberLength = Len(TestNumber) - 1
If TestNumberLength < 0 Then TestNumberLength = 0
tb1.Value = Left(TestNumber, TestNumberLength)
How do I get the displayed value in tb1 to show the new value. Presently
it
only changes when I make the next entry into the box.