Fred,
Assuming you are doing this on a form and not a table you can enter
the following code into the KeyPress event of the text box control.
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And KeyAscii <> vbKeyBack Then
KeyAscii = 0
End If
End Sub
where Text1 is the name of your Text box. This code will only allow
the digits 0-9 and the Period characters to be entered into the box.
If you don't need decimal points omit the . between the square
brackets and if you need negative numbers add a - after the .
HTH
Peter Hibbs.
On Tue, 16 Dec 2008 13:28:30 -0800 (PST), "Fred's"
Hello Peter,