<?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: More VBS help....please in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42387#M303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Cam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I gave you a bum steer I am afraid. I forgot to initialise the txtBox object then set the value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Sub AccessTheUserProperties() Dim objTableForm&amp;nbsp; Set objTableForm = ThisEvent.Object&amp;nbsp; Dim objTablePage&amp;nbsp; Set objTablePage = objTableForm.Pages("Lights")&amp;nbsp; Dim objtxtBox&amp;nbsp; Set objTxtBox = objTablePage.Controls("txtTest")&amp;nbsp; objTxtBox.Text = Application.UserProperties("domMATERIAL") End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2012 06:18:00 GMT</pubDate>
    <dc:creator>GarethWalters</dc:creator>
    <dc:date>2012-07-03T06:18:00Z</dc:date>
    <item>
      <title>More VBS help....please</title>
      <link>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42385#M301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I recieved some code from an earlier post - and it has helped me a great deal.&amp;nbsp; I am not new to vb, but the new method of working with AXF's and related tables has me somewhat perplexed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Option Explicit&amp;nbsp; Sub getAllControls() &amp;nbsp;&amp;nbsp;&amp;nbsp; 'get the Form object &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objForm &amp;nbsp;&amp;nbsp;&amp;nbsp; 'ThisEvent access the object based on the event that was executed &amp;nbsp;&amp;nbsp;&amp;nbsp; Set objForm =&amp;nbsp; ThisEvent.Object 'or you could use something like this: Map.Layers("Poles").Forms("EDITFORM")&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objEditPage &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objEditPage = objForm.Pages("General") &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objAllControls &amp;nbsp;&amp;nbsp;&amp;nbsp; Set objAllControls = objEditPage.Controls&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objControl &amp;nbsp;&amp;nbsp;&amp;nbsp; for each objControl in objAllControls &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Creates an application variable which can be used anywhere in ArcPad. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.UserProperties(objControl.Name) = objControl.Value &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.print Application.UserProperties(objControl.Name) &amp;nbsp;&amp;nbsp;&amp;nbsp; next End Sub&amp;nbsp; 'This would set on the tableform onload event Sub AccessTheUserProperties() &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objTableForm &amp;nbsp;&amp;nbsp;&amp;nbsp; Set objTableForm = ThisEvent.Object&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objTablePage = objTableForm.Pages("Lights") &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim objtxtBox &amp;nbsp;&amp;nbsp;&amp;nbsp; Set objTxtBox.Text = Application.UserProperties("domMaterial") End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets assume that I have a txtBox ("txtAppl") that contains the intial applicant number stored in the editform for the feature class.&amp;nbsp; I also have a tableform (related table) that also contains a txtBox ("txtAppl") that is empty and want to populate based on the editform "txtAppl" control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe I have set the code up correctly as pointed out, but for some reason, when I get to the "Dim objtxtBox" and "set objtxtBox.Text".&amp;nbsp; The application user properties "txtAppl" throws an error.&amp;nbsp; I believe it is actually throwing the error at the objTxtBox.Text portion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone could explain the flow of the script, it would be greatfully appreciative.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the script I have generated based on Gareth's post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Option Explicit&amp;nbsp; Dim pApplicantsDataForm Dim pApplicantsDataControls Dim pTreesTableForm Dim pTreesDataBaseControls Dim pFieldDataTableForm Dim pFieldDataBasePage Dim pFieldDataBaseControls Dim pFieldDataSiteControls Dim pFieldDataTreeControls&amp;nbsp; Sub InitializeDataCollection()&amp;nbsp;&amp;nbsp; Set pApplicantsDataForm = ThisEvent.Object&amp;nbsp; Set pApplicantsDataControls = pApplicantsDataForm.Pages("page1").Controls&amp;nbsp;&amp;nbsp; Dim objApplicantsDataControls&amp;nbsp; for each objApplicantsDataControls in pApplicantsDataControls &amp;nbsp; Application.UserProperties(objApplicantsDataControls.Name) = objApplicantsDataControls.Value &amp;nbsp; Console.print Application.UserProperties(objApplicantsDataControls.Name)&amp;nbsp; next&amp;nbsp; End Sub&amp;nbsp; Sub InitializeFieldDataTableForm()&amp;nbsp; Set pFieldDataTableForm = ThisEvent.Object&amp;nbsp; Set pFieldDataBasePage = pFieldDataTableForm.Pages("page1")&amp;nbsp;&amp;nbsp; Set pFieldDataBaseControls = pFieldDataTableForm.Pages("page1").Controls&amp;nbsp;&amp;nbsp; Dim txtAppl&amp;nbsp; Set txtAppl.Text = Application.UserProperties("txtAppl") End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 21:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42385#M301</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2012-06-29T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: More VBS help....please</title>
      <link>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42386#M302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Cam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try changing it to txtAppl.Value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let us know how you go.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 05:51:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42386#M302</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2012-07-03T05:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: More VBS help....please</title>
      <link>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42387#M303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Cam,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I gave you a bum steer I am afraid. I forgot to initialise the txtBox object then set the value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Sub AccessTheUserProperties() Dim objTableForm&amp;nbsp; Set objTableForm = ThisEvent.Object&amp;nbsp; Dim objTablePage&amp;nbsp; Set objTablePage = objTableForm.Pages("Lights")&amp;nbsp; Dim objtxtBox&amp;nbsp; Set objTxtBox = objTablePage.Controls("txtTest")&amp;nbsp; objTxtBox.Text = Application.UserProperties("domMATERIAL") End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 06:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/more-vbs-help-please/m-p/42387#M303</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2012-07-03T06:18:00Z</dc:date>
    </item>
  </channel>
</rss>

