Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box Max lenghth ??

Status
Not open for further replies.

87vette

Programmer
Mar 4, 2002
9
US
Hi I am writing a program and I am using a combo box as one of my controls. I want to set a maxlength that a user can only enter 20 characters per entry. does anyone know how i can go about this since the combo box does not have a MaxLength property? Nail the code
 
Could you use something like this?

Private Sub Combo1_KeyPress(KeyAscii As Integer)

If Len(Combo1.Text) > 19 Then
Msgbox "Too many characters"
KeyAscii = 0
End If

End Sub
 
Thanks JFOUSHEE! I will try this out today when I get home from work I will let you know how it goes. I cant believe I did not think about this. I use keypress quite a bit. I am pretty sure this will work. Nail the code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top