By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,767 Members | 1,025 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,767 IT Pros & Developers. It's quick & easy.

Limiting the amount of text a user can enter in a text box and willbe printed in a form where the size cannot be expanded?

P: n/a
What do others do to limit the number of characters a user can enter in
a text box? Do you specify the number of characters exactly so that
only that number will fit in the text box, thereby preventing the user
from overfilling the text entry?

Of course, if they do overfill, they can see/view the extra data by
using the arrow key to scroll through the text in the field.

This has been raised on a project I am doing where these text boxes are
ultimately printed on top of preprinted forms. Only so much space for
the text box on the form so I cannot use "can expand" properties.

thanks

Bob
May 23 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
On May 23, 5:06 pm, Bob Alston <bobalst...@yahoo.comwrote:
What do others do to limit the number of characters a user can enter in
a text box? Do you specify the number of characters exactly so that
only that number will fit in the text box, thereby preventing the user
from overfilling the text entry?

Of course, if they do overfill, they can see/view the extra data by
using the arrow key to scroll through the text in the field.

This has been raised on a project I am doing where these text boxes are
ultimately printed on top of preprinted forms. Only so much space for
the text box on the form so I cannot use "can expand" properties.

thanks

Bob
Here's what I still use:

http://groups.google.com/group/comp....a0bbcaf3f5428c

James A. Fortune
CD********@FortuneJames.com

May 23 '07 #2

P: n/a
rkc
CD********@FortuneJames.com wrote:
On May 23, 5:06 pm, Bob Alston <bobalst...@yahoo.comwrote:
>What do others do to limit the number of characters a user can enter in
a text box? Do you specify the number of characters exactly so that
only that number will fit in the text box, thereby preventing the user
from overfilling the text entry?

Of course, if they do overfill, they can see/view the extra data by
using the arrow key to scroll through the text in the field.

This has been raised on a project I am doing where these text boxes are
ultimately printed on top of preprinted forms. Only so much space for
the text box on the form so I cannot use "can expand" properties.

thanks

Bob

Here's what I still use:

http://groups.google.com/group/comp....a0bbcaf3f5428c
From your code:

txtBox.SetFocus 'I forgot why I put this line here
If Len(txtBox.Text) = intMax Then
If KeyAscii <8 Then LimitField = 0
End If

You set focus to the textbox because you can not reference the
..text property unless focus is on the control.
May 24 '07 #3

P: n/a
On May 24, 6:02 am, rkc <r...@rkcny.yabba.dabba.do.comwrote:
From your code:

txtBox.SetFocus 'I forgot why I put this line here
If Len(txtBox.Text) = intMax Then
If KeyAscii <8 Then LimitField = 0
End If

You set focus to the textbox because you can not reference the
.text property unless focus is on the control
Thanks. That makes sense. I forgot that I left the I forgot comment
line there :-).

James A. Fortune
CD********@FortuneJames.com

May 24 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.