Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • Last Modified:

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

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
psmithphil
Asked:
psmithphil
  • 6
  • 3
  • 2
  • +1
2 Solutions
 
SicosCommented:
Normaly it can hold 64 KiloBytes ... so I don't know what is wrong with youre app...

Greetings,
Sicos
0
 
BobHewickCommented:
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
 
psmithphilAuthor Commented:
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
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!

 
psmithphilAuthor Commented:
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
 
BobHewickCommented:
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
 
BobHewickCommented:
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
 
Erick37Commented:
What line of code is giving the error?
How are you setting the text?

0
 
psmithphilAuthor Commented:
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
 
psmithphilAuthor Commented:
As I look at this, I think it's more a matter of the # of lines and not the number of bytes.
0
 
psmithphilAuthor Commented:
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
 
Erick37Commented:
"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
 
psmithphilAuthor Commented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now