error messange when trying to enter long string to table

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi all,
I'm trying to run SQL sentence via DoCmd event,
from some reason when i'm doing it via the code its flaging with an
error of lenth but when i'm running it with a usual query i'm not
getting this error

this is the example of the string i'm tring to enter:
"+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+20+24+25+26+27"
is there an option to run the code without the error?
 
A SQL string can be 2048 characters long. If you exceed the length, you will
get an error. If you have a saved query that runs fine, try using:

DoCmd.OpenQuery

to run it successfully in code.
 
the question is what should i do if i dont want to run query and just
activate nynamic one via VBA code?

Arvin Meyer [MVP] ëúá:
 
the error is as follow:
Run-time error '-2147217833'
the field is too small to accept the amount of data you attempted to
add.try to inserting
or pasting less data"
thread כתב:
 
Hi Arvin

I found out that i can accually use the function
DoCmd.RunSQL
and this will prevent the error to raise
as probbly throut the object the data is les allocated in the memory

thread כתב:
 
Increase the number of characters the field can hold. It should be at least
the maximum length the string you want to put in the field can become. If it
exceeds or an exceed 255 characters, change the field type from text to memo.

---
Gerwin Berentschot
(e-mail address removed).(nospam)
Mr. Access - Access development and training
 

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

Back
Top