You can use the forms current event to initially compute the number of
characters remaining using the controls Value property, but once the control
has the focus, you will need to use the Text property to get the current
number of characters. Use the controls Change event and the Text property to
display the number of characters used or remaining. The text property is
only available while that control has the focus, so it is ideal for use in
the change event.
Something like:
Private Sub txt_SomeField_Change
me.lbl_SomeField_Length.Caption = 255 - len(me.txt_SomeField.Text) & "
characters remaining"
End Sub
HTH
Dale
--
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
"The Report Guy" wrote:
> Hi,
>
> I comments txt field with a max character of 255. I like to have on my form
> letting the user know the number of characters that the user has entered.
>
> I try the Len([comments]) but that only works after they moved on to another
> field. I need the field to instantly know the number of characters as they
> type.
>
> Any suggestions.
>
> Thanks
|