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

8342
12
Jump to solution
02-09-2016 08:04 AM
johnpolo
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.

0 Kudos
1 Solution

Accepted Solutions
WesMiller
Regular Contributor III
0 Kudos
12 Replies
AdrianWelsh
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.

0 Kudos
johnpolo
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.

0 Kudos
WesMiller
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.

johnpolo
New Contributor III

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

0 Kudos
WesMiller
Regular Contributor III

Just to make sure are enclosing your text in quotes?

Using the Calculate Field tool—Help | ArcGIS for Desktop

0 Kudos
johnpolo
New Contributor III

That was it: missing quotes.

*headdesk*

Thank you, Wes.

0 Kudos
AdrianWelsh
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... 

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

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



Think Location
0 Kudos
johnpolo
New Contributor III

Thank you, Jayantar. Got it figured out.

0 Kudos