Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The field is too small....

Status
Not open for further replies.

regava

Programmer
May 24, 2001
152
US
I have the following code:
Set db = CurrentDb()
Set rec = Db.OpenRecordset("tblTracking')
rec.Addnew
When the last statement is executed I get the following message: "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."
Can somebody tell me what is this all about? Thank you for your help.
Rene.
 
Hi Rene

Are you sure that the code is not breaking on the line or a line immediately following the Rec.AddNew ? The error that you mentioned typically happens when trying to paste a string value that is larger then the field will allow. Example; the field is set to hold 50 characters but you are attempting to insert a string with 51 or more characters.

Try opening your table in design view and increasing the field size property to accept more characters.
 
Kevin, thank you for your reply. I checked all the fields and they seemed to be ok. Also, I moved the three lines of code to the begining of the SUB and get the same message. I will keep on looking. In the mean time I can use all help I can get.
Thnak you
 
I've had this happen to me... it means that the SIZE of your field is too small for the information that you are trying to put into it...

Example:
You have a field named 'FirstName' that has a size of 25.

If you try to put a string that is 26 characters long into that field, you will get the error you got.

What you need to do is either make the field size larger, or make the variable that you want to add smaller.

GComyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top