Use the keypress method on the field in qustion to run the following (the second if statement should be modified if you don't want the user to enter "," or "." characters)
Code:If KeyAscii< Asc("0") Or KeyAscii> Asc("9") Then If KeyAscii = Asc(",") Or KeyAscii = Asc(".") Or KeyAscii = 8 Then 'nothing, we will allow these characters Else 'the user has pressed some key other than 0-9 or "," or "." or backspace KeyAscii = 0 ' cancel the character field.SelStart = 0 field.SelLength = Len(field) Beep End If End If




Reply With Quote