Select to view content in your preferred language

conditional labeling in ArcMap

2675
5
Jump to solution
10-08-2012 10:07 AM
WinstonSastroredjo
Deactivated User
L.S.

I have an event which projects producing wells in Arcmap.
The fieldnames are: Wellname, Field, Xcoord, Ycoord, Latitude, Longitude, etc...
If I only want to display a certain well (e.g. from 29Nowugs04 to 29NOWUGS04) in full capital letters how should the label expression look like in VBScript?

Thanks in advanced.

Regards Winston Sastroredjo
0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
Esri Regular Contributor
Don't use single quote, use double quotes instead.

Function FindLabel ([Wellname])   if ([Wellname] = "29Nowugs04") then    FindLabel = UCase([Wellname])   else   FindLabel = [Wellname]   end if End Function


I get the same error if I use single quotes.

Jeff

View solution in original post

0 Kudos
5 Replies
AnthonyGiles
Honored Contributor
Winston,

try:

Function FindLabel ([Wellname])
  if ([Wellname] = '29Nowugs04') then
   FindLabel = UCase([Wellname])
  else
    FindLabel = [Wellname] 
  end if
End Function


Regards

Anthony
0 Kudos
WinstonSastroredjo
Deactivated User
Hey Anthony, I got an error

[ATTACH=CONFIG]18393[/ATTACH]

Any other deas?

Regards Winston
0 Kudos
JeffBarrette
Esri Regular Contributor
Don't use single quote, use double quotes instead.

Function FindLabel ([Wellname])   if ([Wellname] = "29Nowugs04") then    FindLabel = UCase([Wellname])   else   FindLabel = [Wellname]   end if End Function


I get the same error if I use single quotes.

Jeff
0 Kudos
WinstonSastroredjo
Deactivated User
Thanks Jef
0 Kudos
AnthonyGiles
Honored Contributor
Winston,

Glad you got it working sorry about the quotes, that will teach me for posting from my iPad

Regards

Anthony
0 Kudos