hi,
i am able to validate decimal input with TextBox. I used the following codings so that only 2 numbers are allowed aftr decimal.also, only 1 decimal is allowed in a textbox.

VB Code:
  1. Option Explicit
  2. Dim k, s, c
  3.  
  4. Private Sub Text1_Change()
  5. If Len(Text1.Text) = s Then
  6. Command1.SetFocus
  7. End If
  8. End Sub
  9.  
  10. Private Sub Text1_KeyPress(KeyAscii As Integer)
  11. k = Chr(KeyAscii) Like "[0-9]"
  12.  
  13. If KeyAscii = 46 And c >= 1 Then
  14. KeyAscii = 0
  15. End If
  16.  
  17. If KeyAscii = 46 Then
  18. s = Len(Text1.Text) + 3
  19. c = c + 1
  20. End If
  21. End Sub

the problem arises when i use backspace.i am unable to type Decimal point again.

hw shud i track whether decimal point is being erased or not.so that aftr typing decimal point for second time{(ie)aftr erasing first one using backspace},only 2 digits are allowed aftr it.

plzzzz help me solve this.