Author |
Message |
Dennis Steinaue #1 / 11
|
 Counting characters as they are typed
I'm trying to add a character counting (textbox) control right next to a large text entry control whose recordsource is either max length text field or a memo field. Although I know I've seen some guidance on this somewhere, I can't locate it. Basically, as each character is entered (or deleted) in the large text box, I want to recalculate the length of the current string being entered and update the character-count box. Although I thought the OnChange event triggers for each character typed, only the first character type seems to trigger it; thus the field isn't updated past that. I've tried KeyDown, etc. to accomplish this, but so far no joy. This is probably something that some people do regularly, so I'm hoping someone will tell me what I'm doing wrong. Thanks
|
Wed, 20 Jul 2005 05:50:29 GMT |
|
 |
Dirk Goldga #2 / 11
|
 Counting characters as they are typed
I don't have any trouble using the Change event for this. This code works for me: Private Sub Text0_Change() Me.Text2 = Len(Me.Text0.Text & "") End Sub -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup)
Quote: > I'm trying to add a character counting (textbox) control right next to a > large text entry control whose recordsource is either max length text field > or a memo field. Although I know I've seen some guidance on this somewhere, > I can't locate it. Basically, as each character is entered (or deleted) in > the large text box, I want to recalculate the length of the current string > being entered and update the character-count box. Although I thought the > OnChange event triggers for each character typed, only the first character > type seems to trigger it; thus the field isn't updated past that. I've tried > KeyDown, etc. to accomplish this, but so far no joy. This is probably > something that some people do regularly, so I'm hoping someone will tell me > what I'm doing wrong. > Thanks
|
Wed, 20 Jul 2005 07:17:12 GMT |
|
 |
Hugh O'Neil #3 / 11
|
 Counting characters as they are typed
says... Quote: > I don't have any trouble using the Change event for this. This code > works for me: > Private Sub Text0_Change() > Me.Text2 = Len(Me.Text0.Text & "") > End Sub > -- > Dirk Goldgar, MS Access MVP > www.datagnostics.com > (please reply to the newsgroup)
> > I'm trying to add a character counting (textbox) control right next > to a > > large text entry control whose recordsource is either max length > text field > > or a memo field. Although I know I've seen some guidance on this > somewhere, > > I can't locate it. Basically, as each character is entered (or > deleted) in > > the large text box, I want to recalculate the length of the current > string > > being entered and update the character-count box. Although I thought > the > > OnChange event triggers for each character typed, only the first > character > > type seems to trigger it; thus the field isn't updated past that. > I've tried > > KeyDown, etc. to accomplish this, but so far no joy. This is > probably > > something that some people do regularly, so I'm hoping someone will > tell me > > what I'm doing wrong. > > Thanks
I would thing that is safer than the KeyPress event as I bet the backspace fires the KeyPress when you try to correct your speeling misteaks! Hugh
|
Wed, 20 Jul 2005 09:08:35 GMT |
|
 |
Fred Boe #4 / 11
|
 Counting characters as they are typed
I'll take my misteak medium rare, Hugh! <g> Backspaces to correct spelling...of course...how perceptive of you! I just love this type of clever thinking... Fred Boer
Quote:
> says... > > I don't have any trouble using the Change event for this. This code > > works for me: > > Private Sub Text0_Change() > > Me.Text2 = Len(Me.Text0.Text & "") > > End Sub > > -- > > Dirk Goldgar, MS Access MVP > > www.datagnostics.com > > (please reply to the newsgroup)
> > > I'm trying to add a character counting (textbox) control right next > > to a > > > large text entry control whose recordsource is either max length > > text field > > > or a memo field. Although I know I've seen some guidance on this > > somewhere, > > > I can't locate it. Basically, as each character is entered (or > > deleted) in > > > the large text box, I want to recalculate the length of the current > > string > > > being entered and update the character-count box. Although I thought > > the > > > OnChange event triggers for each character typed, only the first > > character > > > type seems to trigger it; thus the field isn't updated past that. > > I've tried > > > KeyDown, etc. to accomplish this, but so far no joy. This is > > probably > > > something that some people do regularly, so I'm hoping someone will > > tell me > > > what I'm doing wrong. > > > Thanks > I would thing that is safer than the KeyPress event as I bet the > backspace fires the KeyPress when you try to correct your speeling > misteaks! > Hugh
|
Wed, 20 Jul 2005 12:08:21 GMT |
|
 |
Dirk Goldga #5 / 11
|
 Counting characters as they are typed
Quote: > I don't have any trouble using the Change event for this. This code > works for me: > Private Sub Text0_Change() > Me.Text2 = Len(Me.Text0.Text & "") > End Sub
Correction: the <& ""> isn't necessary, so that line would be better as just Me.Text2 = Len(Me.Text0.Text) -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup)
|
Wed, 20 Jul 2005 16:26:07 GMT |
|
 |
Hugh O'Neil #6 / 11
|
 Counting characters as they are typed
Quote: > I'll take my misteak medium rare, Hugh! <g> > Backspaces to correct spelling...of course...how perceptive of you! I just > love this type of clever thinking... > Fred Boer
> > says... > > > I don't have any trouble using the Change event for this. This code > > > works for me: > > > Private Sub Text0_Change() > > > Me.Text2 = Len(Me.Text0.Text & "") > > > End Sub > > > -- > > > Dirk Goldgar, MS Access MVP > > > www.datagnostics.com > > > (please reply to the newsgroup)
> > > > I'm trying to add a character counting (textbox) control right next > > > to a > > > > large text entry control whose recordsource is either max length > > > text field > > > > or a memo field. Although I know I've seen some guidance on this > > > somewhere, > > > > I can't locate it. Basically, as each character is entered (or > > > deleted) in > > > > the large text box, I want to recalculate the length of the current > > > string > > > > being entered and update the character-count box. Although I thought > > > the > > > > OnChange event triggers for each character typed, only the first > > > character > > > > type seems to trigger it; thus the field isn't updated past that. > > > I've tried > > > > KeyDown, etc. to accomplish this, but so far no joy. This is > > > probably > > > > something that some people do regularly, so I'm hoping someone will
It's just that I remember Assembler coding keyboard and punched tape inputs and determining the baudot (and other pre-ascii) code values! Hugh
|
Wed, 20 Jul 2005 17:25:18 GMT |
|
 |
Fred Boe #7 / 11
|
 Counting characters as they are typed
Ooooh Hugh! Are you ever old! <snicker!> Now, seriously Hugh, you'd better be careful, or everyone will start posting about how *they* were using technology even older than that... I've seen it before in these newsgroups! Soon we'll be back to Jacquard and Babbage! Fred
|
Thu, 21 Jul 2005 11:42:00 GMT |
|
 |
Hugh O'Neil #8 / 11
|
 Counting characters as they are typed
Quote: > Ooooh Hugh! Are you ever old! <snicker!> > Now, seriously Hugh, you'd better be careful, or everyone will start posting > about how *they* were using technology even older than that... I've seen it > before in these newsgroups! Soon we'll be back to Jacquard and Babbage! > Fred
Mere striplings, they were, in my salad days! Hugh
|
Fri, 22 Jul 2005 23:02:32 GMT |
|
 |
Tim Hanse #9 / 11
|
 Counting characters as they are typed
You're right! Why I remember having to learn QuickBasic ;-} Tim (youngster in the coding world) Hansen
======================== Quote: >-----Original Message----- >Ooooh Hugh! Are you ever old! <snicker!> >Now, seriously Hugh, you'd better be careful, or everyone will start posting >about how *they* were using technology even older than
that... I've seen it Quote: >before in these newsgroups! Soon we'll be back to
Jacquard and Babbage! Quote:
|
Sat, 23 Jul 2005 02:55:57 GMT |
|
 |
Tim Ferguso #10 / 11
|
 Counting characters as they are typed
Quote: > You're right! Why I remember having to learn > QuickBasic ;-}
Gotcha: I learned on Telcomp 2..! Tim F
|
Sat, 23 Jul 2005 03:25:27 GMT |
|
 |
John Vinso #11 / 11
|
 Counting characters as they are typed
On Mon, 03 Feb 2003 11:25:27 -0800, Tim Ferguson Quote:
>> You're right! Why I remember having to learn >> QuickBasic ;-} >Gotcha: I learned on Telcomp 2..!
<pounding my cane on the floor> Young twerps! Why I was using pebbles on the floor when some bright young feller came up with the idea of stringing them on rods... John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public
|
Sat, 23 Jul 2005 04:49:35 GMT |
|
|