Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've got a parcel feature class in ArcGIS 10. Some of the parcels were in the shapefile when I got it. Others I've added after importing the shapefile to a feature class in a personal geodb.

I want to change the font color to white. The code below works for the features I've added, but not for the ones that already existed. For those, the label displays with the code displaying also, and no color change. I don't know why the code would work for some features but not others.

The only difference I can think of is that the original shapefile that I received was probably created in ArcGIS 9, maybe earlier.

Any suggestions on how to get them all to display with the formatted label? Thanks.

Function FindLabel ( [F_NAME], [L_NAME] , [Min_Owner] , [Exp_Date] , [Option_Yrs]  )
  If Not IsNull( [Min_Owner]) Then
    FindLabel = "<CLR red='255' green='255' blue='255'>" & [Min_Owner] & vbnewline & [Exp_Date] & " + " & [Option_Yrs] & "</CLR>" 
  Else 
    FindLabel = [F_NAME] & " " & [L_NAME] 
  End If
End Function
share|improve this question
add comment

2 Answers

Hmm, mystery solved. There was a comma the value in [Min_Owner]. That apparently threw the code off. Being able to escape that would be nice, but it works well enough for now.

share|improve this answer
1  
You may want to choose this as the correct answer so the Community bot stops bumping it up to the front page. –  Patrick Aug 18 '11 at 17:39
add comment

According to the help topic Building Label Expressions, only < and & are special characters and they can be escaped using HTML-style escapes, i.e. &lt; and &gt;. The comma shouldn't create a problem and if it does, it may be a bug.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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