just dont add up

jwlnewsome

Registered User.
Local time
Today, 13:06
Joined
Jan 10, 2006
Messages
20
heres one that just don't add up
from the beginning,
i've got a form that puts data into a table from a text box named txtcomments, the table allows 255 chars to be stored the comments are show later using a copy of the input form, all this works great. now i'm taking this data and inserting it into another table using sql inset in the vb editor so i can play with it and leave the original in tact everything works fine on my test machine but when i transfere the database to the server i am only permitted to enter 127 chars in the text box i've narrowed it down to the sql statement and know that where the error is occuring ive tried deleting things and reinstalling im just going round in circles and when i transfere the database back to the test machine everything works fine the test machine uses access 2003 but the server uses 2000 this is the only differance

any help would be god like

john

ps sql statement as follows looks fine to me,

DoCmd.RunSQL "INSERT INTO tblHistory VALUES([txtcomments]);"
 
not sure it will make a difference but shouldnt this DoCmd.RunSQL "INSERT INTO tblHistory VALUES([txtcomments]);"
be
DoCmd.RunSQL "INSERT INTO tblHistory (SomeField) VALUES([txtcomments]);"

Peter
 
thats if you want to spacificly target a collum to enter the data into i;m entering data into all the collums so as long as your aware of that it doesn't really make much differance. the problem im having isnt with the sql command syntax its with the amount of chars the db will let me enter. when i enter more than 127 chars the error "INVALID ARGUMENT" keeps appearing and when the number is less every thing works fine i just carnt figure out why the table lets me enter 255 chars dirrectly and displays it ok but doesnt let me enter 255 chars through the form text box and insert them
 
DoCmd.RunSQL "INSERT INTO tblHistory VALUES(""" & [txtcomments] & """);"


Since the double-quote is used as the delimiter in the SQL statement, if the text in [txtComments] contains double-quotes, each double-quote in the text needs to be replaced by two consecutive double-quotes.

For example, to save "ABC" in the table, you need to type ""ABC"" in [txtcomments].
.
 

Users who are viewing this thread

Back
Top Bottom