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

How would I keep count of number of characters entered into control?

Status
Not open for further replies.

tvsmvp

Technical User
Aug 17, 2006
59
US
Is there a way to count how many characters are contained in a particular field? In other words, keep a running count of how many characters somebody has typed into a control? Would I use the instr function - or is there a more automated way?
 
Have a look at the Len function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you want to keep a running count of the length, declare a form level integer variable... intRunningCount. Then, in the OnChange event of the textbox, set intRunningCount to Len(Me.txtMyTextBox.Text).
 
Len - but of course. Thanks for the tip. I knew from my excel-ing days that something simple must be available (before I reinvented the wheel).

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top