<?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: auto increment ID in arcpad in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434596#M3127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub CreateUID()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim intRand, myDate, myTime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;intRand = round(rnd*1000000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Map.EditLayer.Forms("Editform").Pages("Page1").Controls("txtUID").Value = "" Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Map.EditLayer.Forms("Editform").Pages("Page1").Controls("txtUID").Value = intRand &amp;amp; "_" &amp;amp; Date()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could then set this to the Page OnSetActive event or the Forms OnLoad event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously you replace the random section with your standard prefix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Jan 2011 21:24:37 GMT</pubDate>
    <dc:creator>GarethWalters</dc:creator>
    <dc:date>2011-01-09T21:24:37Z</dc:date>
    <item>
      <title>auto increment ID in arcpad</title>
      <link>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434594#M3125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to setup and auto incrementing ID in an ArcPad form.&amp;nbsp; I want the ID number to be automatically created upon the creation of the point in arcpad.&amp;nbsp; I would also like the ID number to have a certain format.&amp;nbsp; The first part of the ID would consist of a static text of "U12010" and then grab the FID field and add 100 to it.&amp;nbsp; An example is, 1U2010102.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can easily do this in ArcMap, but I am having trouble figuring out how to do this in ArcPad.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to write VB code a the control properties(onsetfocus) of the field in editform portion of the .apl?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using ArcPad 8&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff Godfrey&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-email-small" href="mailto:jeff.godfrey@co.chelan.wa.us"&gt;jeff.godfrey@co.chelan.wa.us&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 May 2010 16:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434594#M3125</guid>
      <dc:creator>JeffGodfrey</dc:creator>
      <dc:date>2010-05-17T16:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment ID in arcpad</title>
      <link>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434595#M3126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeff-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Short answer- Yes, you need to write a script to do this in ArcPad.&amp;nbsp; You may want to create the unique ID by calling your autoincrement script from the 'On FeatureAdded' event for the layer, and then pass that value to an initialization script the form'OnLoad' event to initialize the form control as it is loading.&amp;nbsp; That said, we had so much trouble getting an autoincrement script to work in ArcPad (no programmers here) that we decided to use a Julian Date (yymmdd + 24:00 hour time) as our unique ID field, which is easily done by accessing the date/time object.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 13:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434595#M3126</guid>
      <dc:creator>DaveAlmond</dc:creator>
      <dc:date>2010-05-19T13:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: auto increment ID in arcpad</title>
      <link>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434596#M3127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub CreateUID()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim intRand, myDate, myTime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;intRand = round(rnd*1000000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Map.EditLayer.Forms("Editform").Pages("Page1").Controls("txtUID").Value = "" Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Map.EditLayer.Forms("Editform").Pages("Page1").Controls("txtUID").Value = intRand &amp;amp; "_" &amp;amp; Date()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could then set this to the Page OnSetActive event or the Forms OnLoad event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously you replace the random section with your standard prefix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jan 2011 21:24:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/auto-increment-id-in-arcpad/m-p/434596#M3127</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2011-01-09T21:24:37Z</dc:date>
    </item>
  </channel>
</rss>

