real time character count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Access 2003 and have a form that has both text and memo fields.
The text fields have character limitations. I've tried a couple of variants
that I've found on the subject (see below) , but I get a control not found
error on the "caption" control. There was insufficient informaiton in the
orginal post for mne to identify the source of the "lblLeftNotes.Caption"
control. Any assistance woud be approeciated.

My text field is CACRDesription with a limit of 1040 characters.

Dim Length As Integer
Length = 1040 - Len(CACRDescription.Text)
lblLeftNotes.Caption = "(" & Length & ")"

Thanks,
Dan
 
I'm using Access 2003 and have a form that has both text and memo fields.
The text fields have character limitations. I've tried a couple of variants
that I've found on the subject (see below) , but I get a control not found
error on the "caption" control. There was insufficient informaiton in the
orginal post for mne to identify the source of the "lblLeftNotes.Caption"
control. Any assistance woud be approeciated.

My text field is CACRDesription with a limit of 1040 characters.

Dim Length As Integer
Length = 1040 - Len(CACRDescription.Text)
lblLeftNotes.Caption = "(" & Length & ")"

Thanks,
Dan

Try using the Me. scoping syntax:
Length = 1040 - Len(Me.CACRDescription.Text)
Me.lblLeftNotes.Caption = "(" & Length & ")"
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
I managed a workaround by using the statusbartext control. For those
interested, the code I used is:

Dim Length As Integer
Length = 1040 - Len(Me.FieldA.Text)
Me.FieldA.StatusBarText = "(" & Length & " characters remaining)"

Note that in a text field 255 char is the max and the form will block
additional characters from being entered. On a memo field the limit is soft,
ie it will allow the user to continue entering data (the remainig characters
will reflect a negaive number)

Dan
 
Back
Top