AnsweredAssumed Answered

VB error in model

Question asked by bg3075 on Jan 10, 2013
Latest reply on Jan 11, 2013 by bg3075
We have recently upgraded from Desktop 9.3 to 10.0, and now are receiving an error when running a model. Unknown if the error is due to the upgrade or not. I do know that we had problems using the field calculator upon upgrading, if a custom toolbox was saved with the 9.3 field calculator. Here is the modelbuilder error:
General error executing calculator. ERROR 999999: Error executing function. Expected end of statement Failed to execute (Calculate Field).
When running the 'Calculate Field' geoprocessor with the VB code below.
Dim dblISOLEVEL As Double Dim lngJoinCnt As Long Dim dblZLEVEL as Double  lngJoinCnt = [Join_Count] dblZLEVEL = [ZLEVEL]  if (lngJoinCnt = 1) and (dblZLEVEL = 0) then dblISOLEVEL = -1 elseif (lngJoinCnt > 1) and (dblZLEVEL = 0) then dblISOLEVEL = dblZLEVEL elseif (lngJoinCnt = 1) and (dblZLEVEL = 5) then dblISOLEVEL = 0 elseif (lngJoinCnt > 1) and (dblZLEVEL = 5) then dblISOLEVEL = dblZLEVEL else  dblISOLEVEL = dblZLEVEL end if

Outcomes