the field is too small to accept the amount of data you attempted to add (1 Viewer)

sneuberg

AWF VIP
Local time
Yesterday, 23:41
Joined
Oct 17, 2014
Messages
3,506
If you found out what is causing your problem would you share the specifics with us for future reference? What was the code or query that resulted in this error?
 

ryetee

Registered User.
Local time
Today, 07:41
Joined
Jul 30, 2013
Messages
952
If you found out what is causing your problem would you share the specifics with us for future reference? What was the code or query that resulted in this error?

I had a query that basically generated the data for the report.
It also referenced a field that wasn't used in the report. We'll call it fieldx from table1. It is defined as a text field of 50 characters. The query has table1.fieldx as one of its fields.
In the vba there is a string strUser and the system Date is referenced as well.

After the open report there is a line as follows ( this is from memory as I don't have the code in front of me so may not be 100% syntactically correct)

Table1.fieldx = table1.fieldx & "/" & date & strUser

The field itself had 48 characters in and was trying to add a further12 hence the error
 

sneuberg

AWF VIP
Local time
Yesterday, 23:41
Joined
Oct 17, 2014
Messages
3,506
Thanks for the feedback. Then it was probably being added via a recordset as MarkK demonstrated in post #12 that that method causes this error to appear. So in the end it appears that this was just a coincidence that this happened when you were modifying the report. A case of post hoc, ergo propter hoc.

I'd fix this if were you. I understand the idea of keep a log of when the report is run but rather than concatenate the date and user info in the same field each time it would be better just to have a table for these log entries and add a new record each time. If you ever want to query this data it will be a lot easier if it is stored that way.
 

ryetee

Registered User.
Local time
Today, 07:41
Joined
Jul 30, 2013
Messages
952
Thanks for the feedback. Then it was probably being added via a recordset as MarkK demonstrated in post #12 that that method causes this error to appear. So in the end it appears that this was just a coincidence that this happened when you were modifying the report. A case of post hoc, ergo propter hoc.

I'd fix this if were you. I understand the idea of keep a log of when the report is run but rather than concatenate the date and user info in the same field each time it would be better just to have a table for these log entries and add a new record each time. If you ever want to query this data it will be a lot easier if it is stored that way.

Flip!! I glossed over MarkK's answer as I thought he was telling you how to make your example fail! Cost me a few hours by not paying attention!

Thanks to all for your help!
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:41
Joined
Sep 12, 2006
Messages
15,718
it's easy to fix your app if it is either in vba, or a query, or, but if it does this in a macro, then I am not sure how to fix it offhand

in vba, you would be updating a recordset so instead of

rst!myfield = "something" & "something else"

then simply

rst!myfield = left("something" & "something else",50) would stop it erroring.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:41
Joined
Feb 28, 2001
Messages
27,337
Now that the techie side of the problem is solved, there is still a philosophical question. If this is, as previously described, a type of audit trail, it might be better to count that update as a separate event (worthy of a new audit record for a new "touch") rather than trying to concatenate messages in what is a rather short message field.
 

Users who are viewing this thread

Top Bottom