I have a table of contents with multiple owner agencies that may or may not have an acreage value in the field and am trying to get a dynamic label expression to only write out the label for the fields that have values.
For example, if the fields were BLM, USFS, Private, and their values were 10.2, "Null", and 5.5 respectively, I would like the dynamic label to read
BLM: 10.2 acres
Private: 5.5 acres
where it skips USFS due to the "Null" value. So far, I have only been able to get this code that I know is incorrect. It returns only the first true value and then does not go to the next in the list.
Function FindLabel ( [BLM] , [BR] , [Private] , [SITLA] )
if ( ( [BLM] ) > 0) then
FindLabel = "BLM: " + [BLM] + " acres"
elseif ( ( [BR] ) > 0) then
FindLabel = "BR: " + [BR] + " acres"
elseif ( ( [Private] ) > 0) then
FindLabel = "Private: " + [Private] + " acres"
elseif ( ( [SITLA] ) > 0) then
FindLabel = "SITLA: " + [SITLA] + " acres"
end if
End Function
Attribute table: