<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcPy Calculate Field Codeblock Error using VB in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323096#M72530</link>
    <description>&lt;P&gt;Any python3 scripting suggestions under this scenario?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 18:00:04 GMT</pubDate>
    <dc:creator>JosephPilkington1</dc:creator>
    <dc:date>2023-08-28T18:00:04Z</dc:date>
    <item>
      <title>ArcPy Calculate Field Codeblock Error using VB</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323010#M72521</link>
      <description>&lt;P&gt;Getting an ExecuteError: ERROR 999999: Error executing function. 99.9% positive the error is in my code block. I know, I should use python, but we are keeping the script consistent with VB. For the life of me I cannot see what I am doing wrong. Probably a quotation thing. I have a real problem with that. Lol. Any help is forever appreciated.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;# &lt;U&gt;Feature Layer Variable&lt;/U&gt;:&lt;BR /&gt;&lt;FONT color="#000000"&gt;TaxParcel_Layer =&lt;/FONT&gt; &lt;FONT color="#339966"&gt;"TaxParcel_Layer"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;# &lt;U&gt;School District Codeblock Variable&lt;/U&gt;:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SCHOOLDISTCodeblock = &lt;FONT color="#339966"&gt;"""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Dim X&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;if ([TaxParcel_INT.SCHOOLDISTNO] = "0091") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "ALMA CENTER SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "0476") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "BLACK RIVER FALLS SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "0485") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "BLAIR-TAYLOR SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "2009") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "GALESVILLE-ETTRICK-TREMPEALEAU SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "3428") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "MELROSE-MINDORO SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel.SCHOOLDISTNO] = "4186") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "OSSEO-FAIRCHILD SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "4368") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "PITTSVILLE SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "5460") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "SPARTA AREA SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "5747") Then &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "TOMAH AREA SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;elseif ([TaxParcel_INT.SCHOOLDISTNO] = "6426") Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;X = "WHITEHALL SCHOOL DISTRICT"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;end if"""&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(TaxParcel_Layer, &lt;FONT color="#339966"&gt;"SCHOOLDIST"&lt;/FONT&gt;, &lt;FONT color="#339966"&gt;"X"&lt;/FONT&gt;, &lt;FONT color="#339966"&gt;"VB"&lt;/FONT&gt;, SCHOOLDISTCodeblock)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 15:38:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323010#M72521</guid>
      <dc:creator>JosephPilkington1</dc:creator>
      <dc:date>2023-08-28T15:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Calculate Field Codeblock Error using VB</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323092#M72529</link>
      <description>&lt;P&gt;You have posted this in ArcGIS Pro place, hence, supported CalculateField languages include&lt;/P&gt;&lt;P&gt;Python, Arcade, SQL&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank"&gt;Calculate Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 17:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323092#M72529</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-28T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Calculate Field Codeblock Error using VB</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323096#M72530</link>
      <description>&lt;P&gt;Any python3 scripting suggestions under this scenario?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 18:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323096#M72530</guid>
      <dc:creator>JosephPilkington1</dc:creator>
      <dc:date>2023-08-28T18:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Calculate Field Codeblock Error using VB</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323172#M72534</link>
      <description>&lt;LI-CODE lang="python"&gt;def school(fld):
    """specify the field name as"""
    if (fld == "0091"):
        X = "ALMA CENTER SCHOOL DISTRICT"
    elif (fld == "0476"):
        X = "BLACK RIVER FALLS SCHOOL DISTRICT"
    elif (fld == "0485"):
        X = "BLAIR-TAYLOR SCHOOL DISTRICT"
    elif (fld =="2009"):
        X = "GALESVILLE-ETTRICK-TREMPEALEAU SCHOOL DISTRICT"
    elif (fld =="3428"):
        X = "MELROSE-MINDORO SCHOOL DISTRICT"
    elif (fld == "4186"):
        X = "OSSEO-FAIRCHILD SCHOOL DISTRICT"
    elif (fld == "4368"):
        X = "PITTSVILLE SCHOOL DISTRICT"
    elif (fld == "5460"):
        X = "SPARTA AREA SCHOOL DISTRICT"
    elif (fld == "5747"):
        X = "TOMAH AREA SCHOOL DISTRICT"
    elif (fld =="6426"):
        X = "WHITEHALL SCHOOL DISTRICT"
    else:
        X = "no clue"
    return X&lt;/LI-CODE&gt;&lt;P&gt;you can begin with a more literal translation, although there are better data structures that could be used in the code block (eg a dictionary), but this should get you started&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 20:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323172#M72534</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-28T20:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Calculate Field Codeblock Error using VB</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323453#M72567</link>
      <description>&lt;P&gt;THANK YOU! Worked like a charm!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 14:02:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-calculate-field-codeblock-error-using-vb/m-p/1323453#M72567</guid>
      <dc:creator>JosephPilkington1</dc:creator>
      <dc:date>2023-08-29T14:02:04Z</dc:date>
    </item>
  </channel>
</rss>

