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!

Limit Characters in Text Box

Status
Not open for further replies.

wandan

Technical User
Dec 16, 2001
101
US
Hi,

I hope this is an easy question. I need to be able to enter the entry of characters in a text box on a form to 250 characaters. Is there an easy way to do this? I thought about the Input Mask. Do I have to enter 250 C's into the custom one?

Thanks.
 
try setting this in your table design. there should be a place where you can specify field size.
 
cghoga's suggestion will work perfectly if the textbox is bound to a field in a table. If you're using unbound controls, you'll need to do a bit of coding. Something like this:

Private Sub MyTextBox_AfterUpdate
Dim strA as String

strA = Left(MyTextBox & Space(250), 250)
MyTextBox = strA

End Sub
 
Thanks for the quick reponse. The information entered into the text box is actually used to build an SQL statement that is run via a Pass Through query. So, I think I will try the coding way.

Thanks Again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top