Hi guys,

Want 2 know some simple code for stopping alphabetical data being entered into a textbox. And allowing numerical data

Got any ideas, my last try was:


VB Code:
  1. Private Sub txtContactno_KeyPress(KeyAscii As Integer)
  2.     If IsNumeric(Chr(KeyAscii)) Then    ' For some reason this doesn't work
  3.         KeyAscii = 0
  4.     End If
  5. End Sub