Private Sub Combo1_KeyPress(KeyAscii As Integer)
Const MAXLENGTH = 8
' If the user is trying to type the 9th key and this key is not the Backspace Key, cancel the event
If Len(Combo1.Text) >= MAXLENGTH And KeyAscii <> vbKeyBack Then
KeyAscii = 0
End If
End Sub