Quote Originally Posted by tommygrayson
Well, KeyCode is new to VB6 or what I heard of, so try DGLienna's suggestion.

I tworks definitely with VB5.

David's code will only work if you type the numbers in. You also have to code the Change event of the textbox to prevent characters other than numbers from being copy 'n pasted in.