I am trying to use one field's contents ([Condition]) as a condition for populating another field ([Intact]). I try to run the following code in the Field Calculator, but it never works (and is not very helpful to help me understand why, giving me the "999999" error code).
This is what went into the "Pre-Logic Script Code" box:
Dim x
If [Condition] = "Very good" Then
x = 1
elseif [Condition] = "Reasonably good" Then
x = 1
elseif [Condition] = "Poor" Then
x = 0
elseif [Condition] = "Renovated" Then
x = 1
elseif [Condition] = "Very poor" Then
x = 0
elseif [Condition] = "Good" Then
x = 1
else
x = 0
end if
And simply x went into the "Intact =" box.
Is there any idea why this code does not work? Again, I'm trying to populate the "Intact" field with 0s or 1s depending on the value of the "Condition" field in the same feature class.