[GIS] Getting error from ArcGIS Field calculator with vbScript

arcgis-10.0arcgis-desktopfield-calculatorvbscript

I am trying to do the following in the field calculator in ArcGIS 10

if  [IncdStDir] = " " then [IncdStNo] &" " & [IncdStName] &" " & [IncdStSfx]

else  [IncdStNo] &" " & [IncdStDir]&" " & [IncdStName] &" " & [IncdStSfx]

end if

I keep getting an error when I try to run this. I am new to Vb.

Best Answer

Updated code as @Russell Mercer suggested.

Make sure you have the advanced checkbox checked and are calculating on the field you want the result posted to. Try this:

Dim output

if  [IncdStDir] = " " then
output = [IncdStNo] & " " & [IncdStName] & " " & [IncdStSfx]

else 

output = [IncdStNo] & " " & [IncdStDir] & " " & [IncdStName] & " " & [IncdStSfx]

end if

And include output variable in the Prelogic section.