Is This Content Helpful?
We're glad to know this article was helpful.
This document illustrates creating stacked labels based on a single field. For example, a field with both city name and state name, such as "Anchorage Alaska", will be labeled as:
This method does not work well for values with more than one space. For example, "Los Angeles California" will be labeled as:
State: Angeles California
For values that do not contain a space, it will not label the feature.
Function FindLabel ( [City_State] )
Dim theString, LeftStr, RightStr, ThePos
theString = [City_State]
ThePos = Instr(theString, " ") - 1
LeftStr = Left (theString, ThePos)
RightStr = Right (theString, Len(thestring) - ThePos)
FindLabel = "City: "&LeftStr&VBNewLine&"State: "&RightStr
When using this code on your table, replace both occurrences of the City_State field name with the name of the field in your table.