I try to label a field according to his length with VBScripting in ArcGIS 10.0

The idea is, if my field is more than a certain length, then please add a new line and split the field correctly. My field can be Null.

I can't get the code below to work (Verify returns nothing):

Function FindLabel ( [JOIN_NUMBER] ) If IsNull([JOIN_NUMBER] ) Then FindLabel = [JOIN_NUMBER] Else FindLabel = Left([JOIN_NUMBER] ,8) & vbnewline & Right([JOIN_NUMBER] ,Len([JOIN_NUMBER] ,-8)) End If End Function

1 Answer 1


Shouldn't it be:

  • That's it. Also my condition was wrong because I have also not Null fields that were < 8 caracters long. So they "disappear" because of the else statment. Great now :)
    – julienr
    Oct 14, 2013 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.