Calculate field tool is assigning the FIRST VALUE to all the records!!!

574
2
06-17-2012 09:16 PM
AshakaThakore
New Contributor II
I am trying to calculate field
i m using vb type of expression

in the codeblock i have written this code
Dim getCVAL
If (Diameter>10) Then
  getCVAL="1234"
else
  getCVAL="4567"
End if

in the expression, i have written getCVAL

Calculate field tool is assigning the FIRST VALUE to all the records!!!

now what is wrong with this code,
please help thanks
0 Kudos
2 Replies
MarcinGasior
Regular Contributor
If "Diameter" is a field containing values, it should be in [] brackets:
Dim getCVAL
If [Diameter] > 10 Then
  getCVAL = "1234"
Else
  getCVAL = "4567"
End If
0 Kudos
AshakaThakore
New Contributor II
yes its a field... thanks a lot
0 Kudos