?
Solved

Maximum number of characters that can go in a Multiline textbox?

Posted on 2005-02-24
12
Medium Priority
?
531 Views
Last Modified: 2012-06-21
I have Visual Basic 6.  I have a textbox with "Multiline" set to "true".  What is the maximum number of characters that can go in this textbox?   And is there a limit to the # of lines?

When I have 2200 characters going to this field (it's taking several fields from a text file on one line), I get "Run-time error 5,  Invalid procedure call or argument".    When I reduce it to 800 characters, it works fine with no errors.
0
Comment
Question by:psmithphil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 4

Expert Comment

by:Sicos
ID: 13397340
Normaly it can hold 64 KiloBytes ... so I don't know what is wrong with youre app...

Greetings,
Sicos
0
 

Assisted Solution

by:BobHewick
BobHewick earned 1200 total points
ID: 13397747
The Text setting for a TextBox control is limited to 2048 characters unless the MultiLine property is True, in which case the limit is about 32K.

So you are most probably attempting to set the text before setting the Multiline=True, have you set this property at design time or in code??
0
 

Author Comment

by:psmithphil
ID: 13397845
Bob, I have set the property at design time.  Perhaps there is something wrong in one of the fields or something.  Are you sure about the sizes you mention?  Thanks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:psmithphil
ID: 13398019
I saw that the longest line for a record that loads correctly is 977 columns.  The one that is failing is 2424 columns and seems to truncate.  Perhaps the max is 2424 characters?
0
 

Expert Comment

by:BobHewick
ID: 13398030
Positive, got the info from MSDN library....

I would stick a debug.print before you set the text property and output the multiline property settings

debug.print "Multiline=" & text1.multiline

No probs..
0
 

Expert Comment

by:BobHewick
ID: 13398149
I have just done a test here and couldnt get an error 5 invalid procedure call.. I suspect your problem lys else where, this sort of error usually happens if you try and sett the focus to a control that is not enabled. What service pack are you using and what version of visual basic (pro, enterprise etc??)

The max characters i got to was 65535
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13398581
What line of code is giving the error?
How are you setting the text?

0
 

Author Comment

by:psmithphil
ID: 13399127
I appreciate everyone's comments.   It may lie in another issue and not the size, and if that's the case, I need to create another Question.  Let me check one thing and get back with you asap.  Bob, what did you search for in the MSDN Library?
0
 

Author Comment

by:psmithphil
ID: 13403807
As I look at this, I think it's more a matter of the # of lines and not the number of bytes.
0
 

Author Comment

by:psmithphil
ID: 13403920
I just installed the MSDN Libraries and can't find anything on the size of the textbox or how many lines a multiline textbox can handle.  I'm still looking but can anyone tell me what to search on?  I find a lot of info on multline textboxes, but not the info I need.
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 800 total points
ID: 13404292
"The Text setting for a TextBox control is limited to 2048 characters unless the MultiLine property is True, in which case the limit is about 32K."


"Text Property"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbprotext.asp
0
 

Author Comment

by:psmithphil
ID: 13408203
Well, I guess there is no way to determine if there's a limit to the number of lines a multiline textbox can handle.  I'm splitting the points since Bob was first to tell me the size and Erick gave me the link to prove it.  That link looks pretty handy for other things as well.  If I've treated anyone unfairly, please let me know and I'll make amends.

Thank you, men, for your outstanding help!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question