I need help on this error message

Discussion created by GISGURU_001 on Aug 7, 2012
Latest reply on Aug 16, 2012 by bruce.nielsen
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