PC Review


Reply
Thread Tools Rate Thread

Count keystrokes

 
 
PennStan
Guest
Posts: n/a
 
      28th May 2006
I have a simple data entry form where users are requested to type in a
description of work performed. I want to limit the amount of text they can
enter and would like to display a "live" counter that tells them how many
characters they can enter. This counter would decrease as they made each
keystroke and stop at zero. Appreciate any suggestions or alternatives to
the counter.


 
Reply With Quote
 
 
 
 
Ardus Petus
Guest
Posts: n/a
 
      28th May 2006
Here's an example: http://cjoint.com/?fCrDQAoHPX

Userform's code is as follows.

Cheers,
--
AP

'---------------------------------------------------------------
Public bCancel As Boolean

Private Sub UserForm_Activate()
tbWorkDescription.Value = ActiveCell.Value
tbWorkDescription_Change
End Sub

Private Sub tbWorkDescription_Change()
Dim iCurrLen As Integer
iCurrLen = Len(tbWorkDescription.Text)
If iCurrLen >= iMaxChar Then
Beep
tbWorkDescription.Value = Left(tbWorkDescription.Value, iMaxChar)
iCurrLen = iMaxChar
End If
Me.lblCharLeft = iMaxChar - iCurrLen
End Sub

Private Sub cbOK_Click()
bCancel = False
Me.Hide
End Sub

Private Sub cbCancel_Click()
bCancel = True
Me.Hide
End Sub


Private Sub UserForm_Terminate()
cbCancel_Click
End Sub
'---------------------------------------------------------------------------
"PennStan" <(E-Mail Removed)> a écrit dans le message de news:
iPheg.1057$%C6.639@trnddc08...
>I have a simple data entry form where users are requested to type in a
>description of work performed. I want to limit the amount of text they can
>enter and would like to display a "live" counter that tells them how many
>characters they can enter. This counter would decrease as they made each
>keystroke and stop at zero. Appreciate any suggestions or alternatives to
>the counter.
>



 
Reply With Quote
 
Gilles Desjardins
Guest
Posts: n/a
 
      28th May 2006
Try "Validation" in the Data menu. You can limit the number of text
characters people enter. Don't forget to leave a floating text box or
comment to explain your restrictions to the user.
HTH

Gilles
"PennStan" <(E-Mail Removed)> wrote in message
news:iPheg.1057$%C6.639@trnddc08...
>I have a simple data entry form where users are requested to type in a
>description of work performed. I want to limit the amount of text they can
>enter and would like to display a "live" counter that tells them how many
>characters they can enter. This counter would decrease as they made each
>keystroke and stop at zero. Appreciate any suggestions or alternatives to
>the counter.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
count duplicats, display incremental count, restart count at changein value JenIT Microsoft Excel Programming 2 24th Aug 2010 09:10 PM
how to get count(col1), count(col2), count(sol3) with only one query Mario Krsnic Microsoft Access Queries 2 27th Oct 2006 06:52 PM
keystrokes LanFoxx~ Spyware Discussion 1 1st Sep 2005 10:36 PM
Count keystrokes from other applications Tor Inge Schulstad Microsoft VB .NET 1 16th Aug 2005 01:17 PM
keystrokes Lori Microsoft Word New Users 1 30th Jul 2003 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 AM.