<?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: Clone method in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/clone-method/m-p/126575#M870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There isn't a .Clone method for recordsets unfortunately, so I think you'd have to copy the values of the fields to variables, then copy them back to a new record within the recordset, after creating a new record with the .AddNew method. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know why the code here isn't working, I don't mess with recordsets very much, but you might try this in the "onunload" (not sure if it works with "onOK", but it might) event of your form:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ThisEvent.Object.Fields("Etat").value = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ThisEvent.Object gets a reference to the form (if fired from a form's event), and from there you can access the form's fields. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could then put the Application.Map.ReDraw(True) in the onKillActive event of the form. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Oct 2010 13:40:13 GMT</pubDate>
    <dc:creator>EricHajek1</dc:creator>
    <dc:date>2010-10-29T13:40:13Z</dc:date>
    <item>
      <title>Clone method</title>
      <link>https://community.esri.com/t5/arcpad-questions/clone-method/m-p/126574#M869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm quite beginner with ArcPad Studio... Here are 2 problems with my codes. Help and advices are welcome (I'm using ArcPad 8.0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1/ I would like to duplicate a point whish is selected on my map. Here is my code (whish doesn't work) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub DuplicatePoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim objSelLayer, objRS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set objSelLayer = Application.Map.SelectionLayer &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Quitter si pas de points sÃ©lectionnÃ©s&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If objSelLayer Is Nothing Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MsgBox "Aucun point n'a Ã©tÃ© sÃ©lectionnÃ©",vbExclamation,"Aucune sÃ©lection"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Exit Sub &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Identifier le point sÃ©lectionnÃ©&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set objRS = objSelLayer.Records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Bookmark = Application.Map.SelectionBookmark &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'Dupliquer le point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Clone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Application.Map.Redraw(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2/ When I click "OK" after writing informations on a form linked with a shapefile, I would like to change the value of the field "Etat" for the selected feature. Here is my code (whish run after the "onok" event of my form) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub ChangeSymbolColor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim objSelLayer, objRS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set objSelLayer = Application.Map.SelectionLayer &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set objRS = objSelLayer.Records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Bookmark = Application.Map.SelectionBookmark &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Fields("Etat").Value = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; objRS.Update&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Application.Map.Redraw(True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank for help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xavier Legrain&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 08:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/clone-method/m-p/126574#M869</guid>
      <dc:creator>XavierLegrain</dc:creator>
      <dc:date>2010-10-29T08:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Clone method</title>
      <link>https://community.esri.com/t5/arcpad-questions/clone-method/m-p/126575#M870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There isn't a .Clone method for recordsets unfortunately, so I think you'd have to copy the values of the fields to variables, then copy them back to a new record within the recordset, after creating a new record with the .AddNew method. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know why the code here isn't working, I don't mess with recordsets very much, but you might try this in the "onunload" (not sure if it works with "onOK", but it might) event of your form:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ThisEvent.Object.Fields("Etat").value = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ThisEvent.Object gets a reference to the form (if fired from a form's event), and from there you can access the form's fields. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could then put the Application.Map.ReDraw(True) in the onKillActive event of the form. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 13:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/clone-method/m-p/126575#M870</guid>
      <dc:creator>EricHajek1</dc:creator>
      <dc:date>2010-10-29T13:40:13Z</dc:date>
    </item>
  </channel>
</rss>

