Value of Text box being inserted into a memo table field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HELP!
I am trying to insert the value of a text box on a form into a memo field in
a table. I'm using DoCmd.RunSQL INSERT INTO method to get this accomplished.
The whole thing works fine as long as the value in the text box is less than
128 characters. Since it is a memo field in the table, I don't understand
why the length of the text box makes any difference. The code runs fine
unless the text in the text box is longer than 128 characters. Any ideas?

Here's my code (but like I stated, it runs fine unless the text in the text
box is longer than 128 characters):

DoCmd.RunSQL "INSERT INTO HRC ([CLNO],[RESTRICTIVE MEASURE]," & _
"[DESC],[CAUSER],[HRC Expiration],[IsConsentReq]) VALUES (" & _
"Forms!FrmHRCAffectedByOthers!CLNO," & _
"Forms!FrmHRCAffectedByOthers!Text33," & _
"Forms!FrmHRCAffectedByOthers!Text35," & _
"Forms!FrmHRCAffectedByOthers!Text31," & _
"Forms!FrmHRCAffectedByOthers!Text37," & _
"Forms!FrmHRCAffectedByOthers!Check38)"
 
Dear Lanita,

I don't know why, but I suggest you try creating a test form bound to HRC
and add the field you are talking about (DESC?). Try typing in the textbox
to see if it accept more then 128 charaters. It you can, then I think that
would tell you that the problem might be your method. You might also try
inserting text into the field using DAO and see how that results. Are you
trapping errors? An error message might give you the reason for the
problem.

God Bless,

Mark A. Sam
 
I have done the test you suggested and it does in fact accept more than 128
characters. I put a messagebox in my code to see what value it was actually
getting in the INSERT INTO method and it is getting all the characters, but
when it actually tries to insert it, I get an "invalid argument" error. When
the memo field has less than 128 characters, the insert works just fine with
no errors.

Mark A. Sam said:
Dear Lanita,

I don't know why, but I suggest you try creating a test form bound to HRC
and add the field you are talking about (DESC?). Try typing in the textbox
to see if it accept more then 128 charaters. It you can, then I think that
would tell you that the problem might be your method. You might also try
inserting text into the field using DAO and see how that results. Are you
trapping errors? An error message might give you the reason for the
problem.

God Bless,

Mark A. Sam


Lanita said:
HELP!
I am trying to insert the value of a text box on a form into a memo field
in
a table. I'm using DoCmd.RunSQL INSERT INTO method to get this
accomplished.
The whole thing works fine as long as the value in the text box is less
than
128 characters. Since it is a memo field in the table, I don't understand
why the length of the text box makes any difference. The code runs fine
unless the text in the text box is longer than 128 characters. Any ideas?

Here's my code (but like I stated, it runs fine unless the text in the
text
box is longer than 128 characters):

DoCmd.RunSQL "INSERT INTO HRC ([CLNO],[RESTRICTIVE MEASURE]," & _
"[DESC],[CAUSER],[HRC Expiration],[IsConsentReq]) VALUES (" & _
"Forms!FrmHRCAffectedByOthers!CLNO," & _
"Forms!FrmHRCAffectedByOthers!Text33," & _
"Forms!FrmHRCAffectedByOthers!Text35," & _
"Forms!FrmHRCAffectedByOthers!Text31," & _
"Forms!FrmHRCAffectedByOthers!Text37," & _
"Forms!FrmHRCAffectedByOthers!Check38)"
 
If you don't mind, try this. Make a new table with a memo field and try an
insert into that field. Don't copy the existing table, actually create a
new one.



Lanita said:
I have done the test you suggested and it does in fact accept more than 128
characters. I put a messagebox in my code to see what value it was
actually
getting in the INSERT INTO method and it is getting all the characters,
but
when it actually tries to insert it, I get an "invalid argument" error.
When
the memo field has less than 128 characters, the insert works just fine
with
no errors.

Mark A. Sam said:
Dear Lanita,

I don't know why, but I suggest you try creating a test form bound to HRC
and add the field you are talking about (DESC?). Try typing in the
textbox
to see if it accept more then 128 charaters. It you can, then I think
that
would tell you that the problem might be your method. You might also try
inserting text into the field using DAO and see how that results. Are
you
trapping errors? An error message might give you the reason for the
problem.

God Bless,

Mark A. Sam


Lanita said:
HELP!
I am trying to insert the value of a text box on a form into a memo
field
in
a table. I'm using DoCmd.RunSQL INSERT INTO method to get this
accomplished.
The whole thing works fine as long as the value in the text box is less
than
128 characters. Since it is a memo field in the table, I don't
understand
why the length of the text box makes any difference. The code runs
fine
unless the text in the text box is longer than 128 characters. Any
ideas?

Here's my code (but like I stated, it runs fine unless the text in the
text
box is longer than 128 characters):

DoCmd.RunSQL "INSERT INTO HRC ([CLNO],[RESTRICTIVE MEASURE]," & _
"[DESC],[CAUSER],[HRC Expiration],[IsConsentReq]) VALUES (" & _
"Forms!FrmHRCAffectedByOthers!CLNO," & _
"Forms!FrmHRCAffectedByOthers!Text33," & _
"Forms!FrmHRCAffectedByOthers!Text35," & _
"Forms!FrmHRCAffectedByOthers!Text31," & _
"Forms!FrmHRCAffectedByOthers!Text37," & _
"Forms!FrmHRCAffectedByOthers!Check38)"
 
Back
Top