<?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: VBS File Help in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173885#M1228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I might have just had a light bulb come on, but not sure!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with an axf and there is a feature layer in there called Applicants_2011.&amp;nbsp; In ArcStudio, I see that the layername is still Applicants_2011, but in ArcPAD, I look at the name and it is backgroundlayers.axf:Applicants_2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if I am referencing the right things first, but my editform is called EditForm and the Page is called Page1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I keep getting a type mismatch 'GetAllControls'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 1 column 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Source Text Unavailable&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jun 2012 20:20:34 GMT</pubDate>
    <dc:creator>CamKenny</dc:creator>
    <dc:date>2012-06-26T20:20:34Z</dc:date>
    <item>
      <title>VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173881#M1224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an axf file that contains a point feature class and two related tables.&amp;nbsp; Upon creating the axf file, it nicely "generates" the form for my project (editform, tableforms).&amp;nbsp; I now need to do some vb programming to customize the data entry as well as how the data capture will flow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While most of the vb scripting comes naturally to me, I cannot seem to get started in the right direction by defining the variables and making sure I reference the forms properly.&amp;nbsp; I have taken a few stabs at it, but each time, I am left at the first line "Option explicit" - lol&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone has a chunk of code that will get me started, I would be forever indebted.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 14:50:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173881#M1224</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2012-06-22T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173882#M1225</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;To start with try the Quick Start Land Survey tutorial in the Customizing ArcPad help documentation. This shows the steps of where to start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you could give a better description of the project at hand we might be able to give you a better chunk of script.&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>Mon, 25 Jun 2012 00:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173882#M1225</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2012-06-25T00:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173883#M1226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I couldnt find the Quick start land tutorial - I am running ArcPAD 10.&amp;nbsp; Basically, I need help with defining the variables and getting access to the forms (referencing them properly).&amp;nbsp; Once I have established the connection, I can go from there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try to be as clear as possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature class (points) in a gdb (axf)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are also two feature tables. One is related to the feature class, while the other feature table is related to another feature table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I generate the AXF within ArcMap, it goes ahead and creates my nice little form for use in ArcPAD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, when I go to open the axf in Studio, I see (have) an edit form for the feature classes and within the layer definition are two tableforms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, what I need help with is "setting-up" the vbs file to reference the controls on the editform and tableform. I know this is simple enough, but maybe I am reading too much into it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Essentially, I want to create an Editform.onload event that will get the controls from the editform (containing only 1 page) as well as the controls from the tableforms (multiple pages) so that I can pass values back and forth between the feature class and feature tables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 14:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173883#M1226</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2012-06-25T14:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173884#M1227</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;It sounds like you have some fun ahead of you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To begin with, when the form is open you can only access the related table items when those specific pages are initiated. You will have to store the values of the edit form page and then manually go to the table form and use something like the onLoad event on that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Option Explicit

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; 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; 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

'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; 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;If you are after bulk updating of records in the table forms you will need to look at using the DataSource object and supplying a SQL expression that could do so. This tends to be more advanced (purely because you are not using the forms to edit).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how you go.&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>Sat, 11 Dec 2021 08:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173884#M1227</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2021-12-11T08:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173885#M1228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I might have just had a light bulb come on, but not sure!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with an axf and there is a feature layer in there called Applicants_2011.&amp;nbsp; In ArcStudio, I see that the layername is still Applicants_2011, but in ArcPAD, I look at the name and it is backgroundlayers.axf:Applicants_2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if I am referencing the right things first, but my editform is called EditForm and the Page is called Page1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I keep getting a type mismatch 'GetAllControls'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 1 column 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Source Text Unavailable&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2012 20:20:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173885#M1228</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2012-06-26T20:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173886#M1229</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;From a quick diagnosis have you got the script in the correct location? I have attached a couple of screen shots for you to compare.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how you go.&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>Tue, 26 Jun 2012 22:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173886#M1229</guid>
      <dc:creator>ArcPadArcPad</dc:creator>
      <dc:date>2012-06-26T22:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173887#M1230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats exactly what it was.&amp;nbsp; Working with an axf and ArcPAD 10, there is the main area that describes the axf etc.&amp;nbsp; But once you go into the feature layer, layers definition is where the script should go.&amp;nbsp; I was placing the script at the highest level and not in the feature layers area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Works as expected.&amp;nbsp; Thanks for your prompt replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2012 14:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173887#M1230</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2012-06-27T14:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: VBS File Help</title>
      <link>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173888#M1231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry to revive this thread.&amp;nbsp; With respect to the above code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Option Explicit

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; 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; 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

'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; 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 Gareth had pointed out, but for some reason, when I get the Dim objtxtBox and set the variable to .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="lia-code-sample line-numbers language-none"&gt;Option Explicit

Dim pApplicantsDataForm
Dim pApplicantsDataControls
Dim pTreesTableForm
Dim pTreesDataBaseControls
Dim pFieldDataTableForm
Dim pFieldDataBasePage
Dim pFieldDataBaseControls
Dim pFieldDataSiteControls
Dim pFieldDataTreeControls

Sub InitializeDataCollection() 
 Set pApplicantsDataForm = ThisEvent.Object
 Set pApplicantsDataControls = pApplicantsDataForm.Pages("page1").Controls

 Dim objApplicantsDataControls
 for each objApplicantsDataControls in pApplicantsDataControls
&amp;nbsp; Application.UserProperties(objApplicantsDataControls.Name) = objApplicantsDataControls.Value
&amp;nbsp; Console.print Application.UserProperties(objApplicantsDataControls.Name)
 next 
End Sub

Sub InitializeFieldDataTableForm()
 Set pFieldDataTableForm = ThisEvent.Object
 Set pFieldDataBasePage = pFieldDataTableForm.Pages("page1")

 Set pFieldDataBaseControls = pFieldDataTableForm.Pages("page1").Controls

 Dim txtAppl
 Set txtAppl.Text = Application.UserProperties("txtAppl")
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:59:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/vbs-file-help/m-p/173888#M1231</guid>
      <dc:creator>CamKenny</dc:creator>
      <dc:date>2021-12-11T08:59:33Z</dc:date>
    </item>
  </channel>
</rss>

