Field Calculator error on ObjectID = 0, which doesn't exist(?)

5523
11
Jump to solution
02-09-2016 08:04 AM
Highlighted
New Contributor III

I am adding a text/string field, "countyname", to a shapefile table. When I use Field Calculator to change the new fields to "Delaware", I get this error message

The calculated value is invalid for the row with ObjectID = 0. For example, the calculated value may be too large for the field or you may be trying to add a string to a number field. This row will not be updated. Do you want to process the rest of the rows?

It goes on with a warning about what happens if I say yes or no. I select Yes and the process fails. I don't know why this is happening or why it's referring to ObjectID = 0, when there is no such ObjectID. ObjectID starts with 1.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor III
Reply
0 Kudos
11 Replies
Highlighted
MVP Notable Contributor

Sometimes field calculator is buggy. Are you in an edit session? Have you tried restarting ArcMap and making sure this file isn't open anywhere else? Sometimes it takes a few times and some troubleshooting to make the field calculator work.

Reply
0 Kudos
Highlighted
New Contributor III

Adrian, I was not in an edit session. I did restart ArcMap. The shape was only in ArcMap. Thanks for the suggestions, but I still have the problem.

Reply
0 Kudos
Highlighted
Regular Contributor III

You may also want to check your field properties to make sure the field type is string and length is 8 or greater.

Highlighted
New Contributor III

Wes, yes, I selected text and 150 characters. I checked the properties to confirm. Thanks for the suggestion.

Reply
0 Kudos
Highlighted
Regular Contributor III
Reply
0 Kudos
Highlighted
New Contributor III

That was it: missing quotes.

*headdesk*

Thank you, Wes.

Reply
0 Kudos
Highlighted
MVP Notable Contributor

why can't ArcGIS just come out and tell us what we are doing wrong?!? I have been there many times with the quotes thing. It happens to all of us... 

Reply
0 Kudos
Highlighted
Honored Contributor

Try exporting the shapefile to File GDB feature class, and work on it. Does the issue persist?

Reply
0 Kudos
Highlighted
New Contributor III

Thank you, Jayantar. Got it figured out.

Reply
0 Kudos