<?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 Populating a form page with pre-existing values in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564294#M4103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Forum, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to re-edit a previously saved point feature. So I am trying the following: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pLayer = Application.Map.Layers("myLayerName")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If not pLayer.Editable = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Editable = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Edit intBookmark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This opens up the EditForm of myLayerName in Form Mode 2 (="Editing an exisiting feature"). How can I populate the fields of the EditForm with the values that are already stored in the point feature? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently each field in the EditForm is blank.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help! Almar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2011 14:14:28 GMT</pubDate>
    <dc:creator>Almarde_Ronde</dc:creator>
    <dc:date>2011-06-16T14:14:28Z</dc:date>
    <item>
      <title>Populating a form page with pre-existing values</title>
      <link>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564294#M4103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Forum, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to re-edit a previously saved point feature. So I am trying the following: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pLayer = Application.Map.Layers("myLayerName")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If not pLayer.Editable = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Editable = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Edit intBookmark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This opens up the EditForm of myLayerName in Form Mode 2 (="Editing an exisiting feature"). How can I populate the fields of the EditForm with the values that are already stored in the point feature? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently each field in the EditForm is blank.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help! Almar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 14:14:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564294#M4103</guid>
      <dc:creator>Almarde_Ronde</dc:creator>
      <dc:date>2011-06-16T14:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a form page with pre-existing values</title>
      <link>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564295#M4104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the values for textboxes / comboboxes aren't being automatically populated and the textboxes / comboboxes are tied to a field, then that's sort of weird, but in any case they could be accessed and assigned like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Records.Fields("fieldname").value&amp;nbsp;&amp;nbsp; 'Accesses the value of a field after a bookmark has been set&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll need to access the editform/page/control itself, which you can do a bunch of ways, but since you have pLayer already specified:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Forms("EDITFORM").Pages("pagename").Controls("controlname").value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Combining these two statements we get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer.Forms("EDITFORM").Pages("pagename").Controls("controlname").value = pLayer.Records.Fields("fieldname").value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You might put these statements in the onload event of the form rather then the level (applet?) you're calling the other code from.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From inside events, it's easy to get references to things by using ThisEvent.Object, which returns the object associated with the event being fired. For onload of an editform, ThisEvent.Object gets you a reference to the form, and could alter the above statement like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ThisEvent.Object.Pages("pagename").Controls("controlname").value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pages and controls have events as well, so you can hook into stuff at ant level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps! If you have any other more specific questions I'll do my best to answer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 21:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564295#M4104</guid>
      <dc:creator>EricHajek1</dc:creator>
      <dc:date>2011-06-16T21:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a form page with pre-existing values</title>
      <link>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564296#M4105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Eric, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for replying. Yes, I was actually trying to use the OnLoad event of the Editform to set values before, but it just doesn't work. The code "pLayer.Edit" is not in an applet, just as part of the AXF layer, and all form fields are tied to feature fields. Strangely enough, if I just use a line like &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Application.ExecuteCommand ("featureproperties")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on the editable layer, it all works fine. The OnLoad event is triggered, and all fields are populated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have a go with your suggestions, let you know the outcome.&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;Almar.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 09:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564296#M4105</guid>
      <dc:creator>Almarde_Ronde</dc:creator>
      <dc:date>2011-06-17T09:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a form page with pre-existing values</title>
      <link>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564297#M4106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My problem has been solved, turns out I was working with an incorrect bookmark. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The EditForm now shows up with all pre-existing values. Getting the field values of the point being re-edited during the OnLoad of the EditForm is actually quit straight forward by using something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pForm, pFields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pForm = ThisEventObject 'ThisEventObject = EditForm object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If pForm.mode = 2 'Editing existing features&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pFields = ThisEventObject.Fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;etc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The Fields property references the fields of the current record in an Edit Form. This allows you to access fields that are not necessarily bound to any controls on the form." (manual)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 10:34:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/populating-a-form-page-with-pre-existing-values/m-p/564297#M4106</guid>
      <dc:creator>Almarde_Ronde</dc:creator>
      <dc:date>2011-06-20T10:34:25Z</dc:date>
    </item>
  </channel>
</rss>

