I have a NAME
field for multiple assets: Tanks
, Reservoirs
, Pump Stations
, etc. Currently, I have everything labeled using the following script:
[NAME] & vbNewLine & [Vol_Mgal] + " " + "Mgal"
I would like to include the elevation
for just those that contain the word Tank
. Is there a way to do this using script?
Here is my latest attempt:
Function FindLabel ([NAME], [ADDRESS])
if (cLng([ADDRESS]) = "TANK" then
FindLabel = [NAME] & vbNewLine & [Vol_Mgal] + " " + "Mgal" + "," & [ELEVATION]+"ft"
else
FindLabel = [NAME] & vbNewLine & [Vol_Mgal] + " " + "Mgal"
end if
End Function
Results: "Carriage returns are not allowed in simple expressions."
if (cLng([ADDRESS]) = "TANK" then
. You are converting address to a number and trying to compare a number to the text "TANK".