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

How to count characters in a textbox??

Status
Not open for further replies.

zeroc00l

IS-IT--Management
Apr 13, 2001
2
SI
Hi!
How could I count characters in a textbox and display the number of characters in another textbox?
Thanks!
PS. Sorry about my english!
ZeroC00l
 
Hi!

Create the label, or textbox, and set it's visible property to false and then add this code to your unbound text box:

Private Sub YourTextBox_GetFocus()

YourLabel.Visible = True
YourLabel.Caption = Nz(Len(YourTextBox), 0)

End Sub

Private Sub YourTextBox_Change()

YourLabel.Caption = Nz(Len(YourTextBox), 0)

End Sub

Private Sub YourTextBox_LostFocus()

YourLabel.Visible = False

End Sub

This should give you a start.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Hi jebry!
Sorry about this post i had allready found your reply to olekr!
Thanks, that helps a lot!!
ZeroC00l!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top