<?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 Calculate Field VBA Statement If...Then...Else Error in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vba-statement-if-then-else-error/m-p/752097#M24624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not able to use an If Then Else function in my field calculator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked up loads of discussions on this forum and tried several options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Even a basic function will not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong, do I have a version of AG that doesn't support this anymore or is there something else?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using Arcmap 10 service pack 2 and trying the next function in my field calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Pre logic script code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim output as Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If [OBJECTID]=2 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output = 565 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output = 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Field value:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error code 999999 -&amp;gt; so that's not very helpfull...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone an idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Nov 2011 10:39:09 GMT</pubDate>
    <dc:creator>RoyMol</dc:creator>
    <dc:date>2011-11-16T10:39:09Z</dc:date>
    <item>
      <title>Calculate Field VBA Statement If...Then...Else Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vba-statement-if-then-else-error/m-p/752097#M24624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not able to use an If Then Else function in my field calculator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked up loads of discussions on this forum and tried several options.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Even a basic function will not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong, do I have a version of AG that doesn't support this anymore or is there something else?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using Arcmap 10 service pack 2 and trying the next function in my field calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Pre logic script code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim output as Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If [OBJECTID]=2 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output = 565 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output = 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Field value:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error code 999999 -&amp;gt; so that's not very helpfull...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone an idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 10:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vba-statement-if-then-else-error/m-p/752097#M24624</guid>
      <dc:creator>RoyMol</dc:creator>
      <dc:date>2011-11-16T10:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field VBA Statement If...Then...Else Error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vba-statement-if-then-else-error/m-p/752098#M24625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Remove the "as Double" from the dim statement.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 13:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vba-statement-if-then-else-error/m-p/752098#M24625</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2011-11-16T13:00:16Z</dc:date>
    </item>
  </channel>
</rss>

