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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extra, limit characters in text box

Status
Not open for further replies.

bill74

Technical User
Jan 14, 2004
6
US
I need to be able to limit the number of characters a user can enter in a text box. I have not been able to find any info regarding this. I did find how to limit the length of the returned string, but this is not good enough.
 
Here is a snippet of code I use... see if this helps at all...


Dim lng As Integer
lng = Len(Src)

If lng > sz Then
Pad = ""
msg = "String's length exceeds padding size request in Function Pad()." & _
vbCr & "String:" & vbCr & Src & vbCr & "Length = " & lng & vbCr & _
"Padding size request = " & sz & "."
MsgBox msg, , "ADRAS"
Exit Function
End If
 
Is there a way to just limit the number of characters allowed in the text box? For instance if they type 3 characters "ABC", then the textbox allows no more text to be entered. A regular text box just lets you keep typing.
 
There is no such Text box in Extra Basic. You'll have to use a workaround or move your code to VB(A) or some other language that has that functionality if your in a must have situation.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top