<?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 Oncancel for form vs Onquerycancel for pages in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/oncancel-for-form-vs-onquerycancel-for-pages/m-p/326722#M2400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an axf with a custom form that collects street signs. It links to a related table. The field crews mistakenly hit the red X sometimes after collecting signs instead of the OK. I searched the forums for code that will ask them if they intended to cancel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub OnFormCancel &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim bResult&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; bResult = Application.MessageBox ("Are you sure you want to cancel?", apYesNo, "Cancel?")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If bResult = apNo Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ThisEvent.Result = False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If bResult = apYes Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ThisEvent.Result = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I place the call event in the page property events under onquerycancel, it works when they hit the cancel button, yes or no. The code doesn't work on the form properties event under oncancel. It will ask them if they want to cancel but if they click No, the form closes anyway and deletes the point. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2012 16:44:40 GMT</pubDate>
    <dc:creator>DanKlenjoski</dc:creator>
    <dc:date>2012-11-07T16:44:40Z</dc:date>
    <item>
      <title>Oncancel for form vs Onquerycancel for pages</title>
      <link>https://community.esri.com/t5/arcpad-questions/oncancel-for-form-vs-onquerycancel-for-pages/m-p/326722#M2400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an axf with a custom form that collects street signs. It links to a related table. The field crews mistakenly hit the red X sometimes after collecting signs instead of the OK. I searched the forums for code that will ask them if they intended to cancel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub OnFormCancel &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim bResult&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; bResult = Application.MessageBox ("Are you sure you want to cancel?", apYesNo, "Cancel?")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If bResult = apNo Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ThisEvent.Result = False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If bResult = apYes Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ThisEvent.Result = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I place the call event in the page property events under onquerycancel, it works when they hit the cancel button, yes or no. The code doesn't work on the form properties event under oncancel. It will ask them if they want to cancel but if they click No, the form closes anyway and deletes the point. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 16:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/oncancel-for-form-vs-onquerycancel-for-pages/m-p/326722#M2400</guid>
      <dc:creator>DanKlenjoski</dc:creator>
      <dc:date>2012-11-07T16:44:40Z</dc:date>
    </item>
  </channel>
</rss>

