Try this.
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
    If Len(Text1) = 2 Then Text1.SelText = "-"
End Sub