count characters in a memo box

F

Frazzled

Is there a way to count the number of characters in a memo box as
they're being typed? I've created an unbound text box to do the count,
but I can't figure out what to put in there. I've tried Count(Chr( ))
but it wants a specific character code.

Thanks!
 
B

Brendan Reynolds

Private Sub Text0_Change()

Me.Label2.Caption = CStr(Len(Me.Text0.Text))

End Sub

.... where 'Text0' is the text box into which the text is being entered, and
'Label2' is the label in which the number of characters is being displayed.
I used a label instead of a text box because there is no need to accept
input, and a label is a more lightweight control than a text box. If you
decide to continue using a text box, remove the reference to the Caption
property.
 
R

Rob Oldfield

....depends what you want to do with it...

len(me.ctlName.text)

....in the on change event of your memo control is the best I can think of.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top