Repost : limiting lines per textbox and spill it over to 2nd textbox

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

Hi,

I did not get any reply to my original post, so I'm reposting hoping for
wisdom from the gurus.

I want to limit my A2000 form multiline textbox1 to say, 30 lines of text
and get
any further lines of text to spill over to textbox2. This function should
use the onChange event and on GotFocus events, among others.

How can I achieve this ?

Thanks for any help
 
Thanks. I am already using the bulk of the code in that link to get the
linecount. What I can't figure out is the spillover part.

Help !!
 
Couldn't you use the Right() function somewhere to get the second part and
then put it in the second TextBox?

You will have to try on your own if you understand the first part unless
someone else want to test it for you ...
 
I guess we could. Stephen Lebans function returns total linecount in the
textbox. The problem is how do I get to cursor position Line 30.

Once I figure that position in the string then right() is the way to go.

Any wisdom ?
 
You are aware that if the field type you use is a memo type, then you can
have several thousand lines of text into that box, and not have to split it
up...right?

I believe through the UI, you can have 65,000 characters in that field.

If you store all the data in one field, then the need to split it goes
away..right?
 
A For loop iterated 30 times using the InStr() function should do.

Check Access VB Help and NOTE the first argument of the InStr() function.
 
Yes, I did remember that. However if I wanted to limit the amount of data in
Textbox1 to say 30 lines, and Textbox1
is linked to the memo field, then the memo field is limited to the amount of
data allowed in Textbox1, right ?

This will be sort of like the sms box on yahoo messenger, where instead of
stopping the cursor at the upper charactercount limit, I would allow users
to keep typing and any extra lines beyond line 30 would just spillover to
unbound Textbox2.

I would really appreciate any help in getting this to work.

Thanks very much.
 
Back
Top