Index As Integer, KeyAscii As Integer)
    If (KeyAscii &gt;= Asc("0") And KeyAscii &lt;= Asc("9")) Then
    Else
        If (KeyAscii &lt;&gt; 8) And (KeyAscii &lt;&gt; Asc("-")) Then
            KeyAscii = 0
        End If
    End If
End Sub

Private Sub txtWeight_KeyPress(KeyAscii As Integer)
    If (KeyAscii &gt;= Asc("0") And KeyAscii &lt;= Asc("9")) Then
    Else
        If (KeyAscii &lt;&gt; 8) And (KeyAscii &lt;&gt; Asc("-")) Then
            KeyAscii = 0
        End If
    End If
End Sub
</pre><p>&