sorry about that. i was not able to test the code.
here's the tested code.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (Len(Text1) > 7 Or Not IsNumeric(Chr(KeyAscii))) And _
KeyAscii <> vbKeyReturn And _
KeyAscii <> vbKeyBack Then
KeyAscii = 0
End If
End Sub