String Too Long

J

JF Bouthillier

Hi all,

I have a module that concatenates strings together. When
the string exceeds 255 characters, I get the "String Too
Long" error. Is there a way I can avoid this?

Thank you.
JF
 
D

Dirk Goldgar

JF Bouthillier said:
Hi all,

I have a module that concatenates strings together. When
the string exceeds 255 characters, I get the "String Too
Long" error. Is there a way I can avoid this?

Thank you.
JF

255 is not the maximum length of a string variable, but it is the
maximum length of a Text field (not a text box, but a field of type Text
in a table). So if you are storing the output in a field, you'll have
to change that field's type to Memo.
 
J

JF Bouthillier

ok... then I don't know why I get this error... I am
trying to concatenate strings into a variable declared as
Dim WholeString As String. This string is then sent to
Word to populate a cell identified as a book mark.

Would you have an idea what could be my error?

Thanks a lot.
JF
 
D

Dirk Goldgar

JF Bouthillier said:
ok... then I don't know why I get this error... I am
trying to concatenate strings into a variable declared as
Dim WholeString As String. This string is then sent to
Word to populate a cell identified as a book mark.

Would you have an idea what could be my error?

Could it be that you're running into a limit imposed by Word? Set a
breakpoint and step through the code, and see which line raises the
error.
 
J

JF Bouthillier

Yes... you are right. This is a Word error.

It is in the line FormFields("Text1").Result = String.
When the String is longer than 255, it produces this
error.

Would anyone have an idea why?

Thanks.
JF
 
Top