Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TextBox Character Limit? (MS Access 2002 .adp connected to SQL)

16 views
Skip to first unread message

HumanJHawkins

unread,
Apr 2, 2005, 12:23:48 AM4/2/05
to

I have an SQL DB (MS SQL Server 2000 SP 3) with a varchar(1024) field in
it.

I have made an .adp interface for this data. I am trying to allow users
to enter data in _other_ fields and use VB to concatenate other fields
into this 1024 char long field. However, whenever the concatenation
exceeds 255 characters it fails. Oddly, instead of truncating it at
255, it only shows the remaining text after the first 255 characters.

So, if the text is under 255, it works perfectly. But if I go one word
over, the only thing in the text box is that one word that went over.

I am using a standard textbox from the Access tool pallette. The syntax
is very simple, as in (where I have 3 text boxes, each named "Combined",
"Source1", and "Source2"):


Code:
--------------------
Function CombineFields()
Combined = Source1 & Source2
End Function
--------------------


I think the chopping off happens between VB and the text box after I am
done with it... In the debugger, I can see that the strings are fine
when the function is done with them. And, I know the text box can hold
more, because I can type more than 255 chars into it just fine.

Any tips on how to either make this work, or make another solution
would be much appreciated!

Thanks!


--
HumanJHawkins
------------------------------------------------------------------------
HumanJHawkins's Profile: http://www.msusenet.com/member.php?userid=337
View this thread: http://www.msusenet.com/t-1869388021

HumanJHawkins

unread,
Apr 4, 2005, 5:59:47 PM4/4/05
to
"HumanJHawkins" <HumanJHawk...@no-mx.msusenet.com> wrote in message
news:HumanJHawk...@no-mx.msusenet.com...

>
> I have an SQL DB (MS SQL Server 2000 SP 3) with a varchar(1024) field in
> it.
>
> I have made an .adp interface for this data. I am trying to allow users
> to enter data in _other_ fields and use VB to concatenate other fields
> into this 1024 char long field. However, whenever the concatenation
> exceeds 255 characters it fails. Oddly, instead of truncating it at
> 255, it only shows the remaining text after the first 255 characters.
>
> So, if the text is under 255, it works perfectly. But if I go one word
> over, the only thing in the text box is that one word that went over.
<CUT>

The answer is that Access will not send more than 255 chars to a varchar,
even if it can hold more. However, changing the varchar to a "Text" data
type works around this bug in Access.

Cheers!


0 new messages