You can use SendMessage and CB_LIMITTEXT to simulate MaxLength in a Combo's Edit Box.
Put the following code in the BAS module
Code:
Option Explicit
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const CB_LIMITTEXT = &H141
Place the ComboBox and a command button on the form. Add the following code.
Code:
Option Explicit
Private Sub Command1_Click()
Dim imaxlength As Integer
imaxlength = 6
Call SetWindowText(Combo1.hwnd, "")
Call SendMessageLong(Combo1.hwnd, CB_LIMITTEXT, imaxlength, 0&)
End Sub
Ruchi