Textbox character limit length

  • Thread starter nigelb via AccessMonster.com
  • Start date
N

nigelb via AccessMonster.com

I need to display a long text message in a scrollable text box that contains
around 5000 characters, but the character limit for an Access textbox is 2048.
Is there any way I can increase this limit? Or perhaps another control to do
the job?
 
D

Dirk Goldgar

nigelb via AccessMonster.com said:
I need to display a long text message in a scrollable text box that
contains
around 5000 characters, but the character limit for an Access textbox is
2048.
Is there any way I can increase this limit? Or perhaps another control to
do
the job?


Where did you get that limit from? I just checked specifications in my copy
of Access 2003, and it says the maximum number of characters in a text box
is 65,535.
 
M

Marshall Barton

nigelb said:
I need to display a long text message in a scrollable text box that contains
around 5000 characters, but the character limit for an Access textbox is 2048.
Is there any way I can increase this limit? Or perhaps another control to do
the job?


A text box can display up tp 64K characters. You are
probably setting the text box's ControlSource property to a
constant string and the property is limited to 2K.

An alternative would be to set the text box's value using
VBA code like

strText = "this is bunch of text..." _
& "that can be longer than 2K " _
& " . . . "
Me.thetextbox = strText
 
N

nigelb via AccessMonster.com

Really? Whenever I put a string of more than 2048 characters into the textbox
using .text property it says "..too long"


Dirk said:
I need to display a long text message in a scrollable text box that
contains
[quoted text clipped - 3 lines]
do
the job?

Where did you get that limit from? I just checked specifications in my copy
of Access 2003, and it says the maximum number of characters in a text box
is 65,535.
 
N

nigelb via AccessMonster.com

Yep, well instead of using the text property, I use the value property, and
it now works!! Thanks for your help.
 
D

Dirk Goldgar

nigelb via AccessMonster.com said:
Really? Whenever I put a string of more than 2048 characters into the
textbox
using .text property it says "..too long"


Don't use the .Text property. That has only very specialized uses in the
Access text box, which is different from the VB text box. The .Value
property (which is also the default property of the control) is the one you
want to use. Not only that, but the .Value property is available all the
time, whereas the ..Text property is only available when the control has the
focus.
 
N

nigelb via AccessMonster.com

Pefect. I´ve always wondered about the textbox needing focus when I populate
it using .text property. I`ll use .value property from now on. Thanks for
your advice.
 
M

Marshall Barton

nigelb said:
Yep, well instead of using the text property, I use the value property, and
it now works!! Thanks for your help.


Right. The Value property is the default property so you
don't even need to specify Value explicitly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top