Hi Katie,You could use the following:import arcpy
import pythonaddins
class ComboBoxClass1(object):
"""Implementation for UserData_addin.combobox (ComboBox)"""
def __init__(self):
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", "NAME = " + selection)
arcpy.RefreshActiveView()
def onFocus(self, focused):
self.mxd = arcpy.mapping.MapDocument('current')
global layer
layer = arcpy.mapping.ListLayers(self.mxd, "Stream_Temperatures")[0]
self.items = []
with arcpy.da.SearchCursor(layer, ["SampleYear"]) as cursor:
for row in cursor:
self.items.append(row[0])
If the 'Stream_Temperatures' field is a TEXT field, you wlil need to change the query to:arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", "NAME = '" + selection + "'")