def FindLabel ( [Parcel_No], [Owner_Name] ): if [Parcel_No] >= 0: return "<CLR red='255'><FNT size = '14'>" + unicode( [Owner_Name]) + "</FNT></CLR>" else: return [Owner_Name]
Solved! Go to Solution.
You need the ";" after the &
Function FindLabel ([LABELFIELD]) NewString = Replace([LABELFIELD],"&","&") FindLabel = "<ITA>" & NewString & "</ITA>" End Function
The ampersand (&) and angle bracket (<) are special characters and will interfere with the formatting tags. You have to replace them with code similar to this:Function FindLabel ([LABELFIELD]) NewString = Replace([LABELFIELD],"&","&") FindLabel = "<ITA>" & NewString & "</ITA>" End Function
See the help page on formatting tags
def FindLabel ( [Owner_Name] ): test = [Owner_Name].replace( '&', '&') return "<CLR red='255'>" + test + "</CLR>"
You need the ";" after the &
thanks for you help. I tried the ";" after the & and get a syntax error. If I put it after the ")" it labels but still the "&" in the name.
def FindLabel ( [Owner_Name], [Owner_St], [Parcel_No], [Owner_City], [Owner_State], [Property_ID] ): parcelNo = "<BOL>" + "Parcel No.: " + "</BOL>" + [Parcel_No] propertyID = propertyID = "<BOL>" + "Property ID: " + "</BOL>" + [Property_ID] ownerTemp = [Owner_Name].title() ownerName = "<BOL>" + "Owner: " + "</BOL>" + ownerTemp.replace( '&', '&') streetAdd = "<BOL>" + "Address: " + "</BOL>" + [Owner_St].title() ownerCity = "<BOL><CLR black = '0'>" +"Address: "+ "</CLR></BOL>" + [Owner_City].title() LF= '\n' strResult = parcelNo+ LF+ propertyID + LF + ownerName + LF + streetAdd + LF + ownerCity + ", "+ [Owner_State] return strResult
it worked! It's the little things that get you.