<?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 Newbie: Trying to populate one field based on choice in another field in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614651#M4478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am new to ArcPad and new to VBS, so this might be a bit more than I can chew, but here goes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a rather long table that has a code field (sign type) and a description field (sign description).&amp;nbsp; I want my ArcPad users to be able to choose from the Description field and have the code field automatically fill in based on that choice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm assuming that I need to create some sort of a domain table (maybe a .dbf table??) that can be linked to the Description field.&amp;nbsp; From this table the coded value (sign type) would be known, so that it could be automatically populated into the "sign type" field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help direct me on how to go about this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2013 15:59:06 GMT</pubDate>
    <dc:creator>MichaelBishopp</dc:creator>
    <dc:date>2013-03-25T15:59:06Z</dc:date>
    <item>
      <title>Newbie: Trying to populate one field based on choice in another field</title>
      <link>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614651#M4478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am new to ArcPad and new to VBS, so this might be a bit more than I can chew, but here goes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a rather long table that has a code field (sign type) and a description field (sign description).&amp;nbsp; I want my ArcPad users to be able to choose from the Description field and have the code field automatically fill in based on that choice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm assuming that I need to create some sort of a domain table (maybe a .dbf table??) that can be linked to the Description field.&amp;nbsp; From this table the coded value (sign type) would be known, so that it could be automatically populated into the "sign type" field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help direct me on how to go about this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:59:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614651#M4478</guid>
      <dc:creator>MichaelBishopp</dc:creator>
      <dc:date>2013-03-25T15:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie: Trying to populate one field based on choice in another field</title>
      <link>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614652#M4479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you figure this out? I'm looking to do something similar.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2013 01:27:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614652#M4479</guid>
      <dc:creator>KariBuckvold</dc:creator>
      <dc:date>2013-04-02T01:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie: Trying to populate one field based on choice in another field</title>
      <link>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614653#M4480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you figure this out? I'm looking to do something similar.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did find some code that got me started.&amp;nbsp; Here it is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'autopopulate a field based on entry in another field
Sub AutoPop

 Dim objDBF, strCode, strTest, i , strObs, pageGen
 'pageGen = Layers("SignsTest3").Forms("EDITFORM").Pages("General") 'SignsTest3 is the layer
 strObs= Layers("SignsTest3").Forms("EDITFORM").Pages("General").Controls("domDescription").value 'get value user selected in domDescription field
 Set objDBF = Application.CreateAppObject("recordset")&amp;nbsp;&amp;nbsp; 
 objDBF.Open "C:\Users\mbishopp\Documents\SignsTestData1\dbase\Example.dbf", 1&amp;nbsp; 'open the external DBF table &amp;lt;--this should probably be placed somewhere else, like with the apl or axf, but I was just experimenting at the time.
 
 objDBF.MoveFirst 
 For i=0 to objDBF.RecordCount-1&amp;nbsp;&amp;nbsp; 'loop through DBF list until end of list 

&amp;nbsp; If strObs=objDBF.Fields("Descriptio").Value then 'compare selected obs value form with 1st CODE value from table
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp; strTest = objDBF.Fields("SignType").Value 'if form value = CODE value then store associated TEST value in variable
&amp;nbsp;&amp;nbsp; MsgBox(strTest)
&amp;nbsp;&amp;nbsp; Layers("SignsTest3").Forms("EDITFORM").Pages("General").Controls("tbSignType").value = strTest 'Populate the tbSignType control with var strTest
&amp;nbsp;&amp;nbsp; Layers("SignsTest3").Forms("EDITFORM").Pages("General").Controls("tbDescription").value = strObs 'Populate the tbDescription control with var strObs
&amp;nbsp;&amp;nbsp; 'ThisEvent.Object.value=strTest&amp;nbsp;&amp;nbsp; 'enter stored variable into text box on form &amp;lt;--didn't use this, legacy from other user that I stole this from :)
&amp;nbsp; Else&amp;nbsp; 
&amp;nbsp; End If
 objDBF.MoveNext&amp;nbsp; 'goto next record in DBF table
 Next
 
 objDBF.Close&amp;nbsp;&amp;nbsp;&amp;nbsp; 'close DBF table

 Set objDBF = Nothing 

End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully that helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614653#M4480</guid>
      <dc:creator>MichaelBishopp</dc:creator>
      <dc:date>2021-12-12T02:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie: Trying to populate one field based on choice in another field</title>
      <link>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614654#M4481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved the same problem pretty simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try it with a test.shp with two filed NAME and DESC. Your APL needs two combo boxes which active a script after changing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;ArcPad&amp;gt;
 &amp;lt;LAYER name="test.shp"&amp;gt;
&amp;nbsp; &amp;lt;FORMS&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;EDITFORM name="EDITFORM" caption="test" width="130" height="130" picturepagevisible="false" attributespagevisible="false" symbologypagevisible="false" geographypagevisible="false" required="false"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PAGE name="PAGE1" caption="test"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;COMBOBOX name="NAME" x="32" y="22" width="94" height="100" defaultvalue="" listtable="list.dbf" listvaluefield="NAME" listtextfield="NAME" onselok="Call UpdateNameList()" tooltip="" tabstop="true" border="true" sip="true" limittolist="false" sort="false" field="NAME"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;COMBOBOX name="DESC" x="32" y="22" width="94" height="100" defaultvalue="" listtable="list.dbf" listvaluefield="DESC" listtextfield="DESC" onselok="Call UpdateDescList()" tooltip="" tabstop="true" border="true" sip="true" limittolist="false" sort="false" field="SPECIES"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/PAGE&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/EDITFORM&amp;gt;
&amp;nbsp; &amp;lt;/FORMS&amp;gt;
&amp;nbsp; &amp;lt;SCRIPT src="Functions.vbs" language="vbscript"/&amp;gt;
 &amp;lt;/LAYER&amp;gt;
&amp;lt;/ArcPad&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you need your &lt;/SPAN&gt;&lt;STRONG&gt;list.dbf&lt;/STRONG&gt;&lt;SPAN&gt; with a row called &lt;/SPAN&gt;&lt;STRONG&gt;NAME&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;DESC&lt;/STRONG&gt;&lt;SPAN&gt; in the same folder as well as the &lt;/SPAN&gt;&lt;STRONG&gt;Functions.vbs&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub UpdateNameList()
 
 Dim pForm
 Set pForm = ThisEvent.Object.Parent
 
 pForm.Controls("NAME").ListIndex = pForm.Controls("DESC").ListIndex
 
 Set pForm = Nothing

End Sub

Sub UpdateDescList()
 
 Dim pForm
 Set pForm = ThisEvent.Object.Parent
 
 pForm.Controls("DESC").ListIndex = pForm.Controls("NAME").ListIndex
 
 Set pForm = Nothing

End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that works out... The basics idea is that both list have the same Index...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards Valentin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/newbie-trying-to-populate-one-field-based-on/m-p/614654#M4481</guid>
      <dc:creator>ValentinWittich</dc:creator>
      <dc:date>2021-12-12T02:17:22Z</dc:date>
    </item>
  </channel>
</rss>

