I need help on this error message
I was trying to write a custom python script for Definition query for a particular layer and this error message was what i got
NameError: name 'field' is not defined
after entering the following codes -
#Variables to form defintion query
field = '"Name_Allottee"'
value = "'Fadare A Adetoye'"
#concatenate query syntax
queryStr = "Name_Allottee" + "=" + "Fadare A Adetoye"
#Specify the MXD project (CURRENT), dataframe (Layers)
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")
#Apply defintion query to specified layer group (KWAGIS_Parcels)
for lyr in arcpy.mapping.ListLayers(mxd, "KWAGIS_Parcel", df):
if lyr.supports("DEFINITIONQUERY"):
lyr.definitionQuery = queryStr
arcpy.RefreshActiveView()