Character Count on a Form (1 Viewer)

123James

Registered User.
Local time
Yesterday, 17:03
Joined
May 15, 2006
Messages
60
hello

I have searched the forum for character and word count tools that can be added onto forms but have only found an example that is too complicated for me.

Can anyone tell me of a simple way to, on a form, display next to a memo field how many characters (including spaces) have been entered?

All suggestions appreciated...
James
 

Dennisk

AWF VIP
Local time
Today, 01:03
Joined
Jul 22, 2004
Messages
1,649
trim(len(me!myMemoName)) would probally give you the answer you require
 

123James

Registered User.
Local time
Yesterday, 17:03
Joined
May 15, 2006
Messages
60
Thanks for the reply, should I just enter this into the ControlSource of a text box dragged onto the same form as the memo field??
 

boblarson

Smeghead
Local time
Yesterday, 17:03
Joined
Jan 12, 2001
Messages
32,059
Put an unbound text box on the same form as the memo field and in the memo field's

On Change event put
Code:
Me.MyMemoCountTextBoxNameHere = Len(Me.MyMemoName.Text)
If you use trim as Dennisk suggests then it will ignore spaces at the end, but you specifically stated you wanted spaces included. Also, if you use Me.myMemoName as he suggests it won't give you the total until the after update of the control.
 

123James

Registered User.
Local time
Yesterday, 17:03
Joined
May 15, 2006
Messages
60
Thanks for the reply bob.

I copied the code into the On Change event and edited the names to match my text box and memo field but keep getting an error message...

"Microsoft can't find the macro Me."

I also tried the code in the After Update event but no luck!

any ideas??
 

123James

Registered User.
Local time
Yesterday, 17:03
Joined
May 15, 2006
Messages
60
Sorry about not replying but only just got back to work this morning!

I managed to find a simple sample of the character count that I have edited and this works fine.

thanks anyways
James
 

Users who are viewing this thread

Top Bottom