A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Textbox Character Counter



 
 
Thread Tools Display Modes
  #1  
Old January 20th, 2010, 12:03 AM posted to microsoft.public.access.forms
User via AccessMonster.com
external usenet poster
 
Posts: 28
Default Textbox Character Counter

I'm trying to display the character count of a textbox in a label.

The format I'm trying to achieve is something like: "1/60 Characters"

60 being the feild size I set for that textbox.

Any help would be great.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1

  #2  
Old January 20th, 2010, 01:17 AM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Textbox Character Counter

On Wed, 20 Jan 2010 00:03:04 GMT, User via AccessMonster.com wrote:

I'm trying to display the character count of a textbox in a label.

The format I'm trying to achieve is something like: "1/60 Characters"

60 being the feild size I set for that textbox.

Any help would be great.


Using an unbound control:
=Len([ControlName]) & "/60"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old January 20th, 2010, 03:17 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Textbox Character Counter

On Wed, 20 Jan 2010 00:03:04 GMT, "User via AccessMonster.com" u36225@uwe
wrote:

I'm trying to display the character count of a textbox in a label.

The format I'm trying to achieve is something like: "1/60 Characters"

60 being the feild size I set for that textbox.

Any help would be great.


Use the Change event of the textbox, which fires at every keystroke. For
example, put an unbound textbox txtChrs on the form, with a label containing
"/60 Characters" as its caption just to the right of the textbox. In the
Change event (and, if you want to see it for existing records, in the form's
Current event too) put

Private Sub yourtextbox_Change()
Me!txtChrs = Len(Me!yourtextbox)
End Sub

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.