<?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 Cancel close form in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/cancel-close-form/m-p/267336#M1944</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 am trying to write a script for an editform in ArcPad, that should make it possible to Cancel the closing of the form if the cancel button is clicked, e.g. by a msgbox "Are you sure you need to close the form?". &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to put this code into the onunload event of the form, but with no luck;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;If MsgBox("Close?", vbYesNo) = vbYes Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp; Cancel = True
&amp;nbsp; End If&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;When the user clicks No, the form still closes! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody help here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rasmus&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Nov 2010 19:26:29 GMT</pubDate>
    <dc:creator>rasmusborgstrøm</dc:creator>
    <dc:date>2010-11-10T19:26:29Z</dc:date>
    <item>
      <title>Cancel close form</title>
      <link>https://community.esri.com/t5/arcpad-questions/cancel-close-form/m-p/267336#M1944</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 am trying to write a script for an editform in ArcPad, that should make it possible to Cancel the closing of the form if the cancel button is clicked, e.g. by a msgbox "Are you sure you need to close the form?". &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to put this code into the onunload event of the form, but with no luck;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;If MsgBox("Close?", vbYesNo) = vbYes Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp; Cancel = True
&amp;nbsp; End If&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;When the user clicks No, the form still closes! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody help here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rasmus&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 19:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/cancel-close-form/m-p/267336#M1944</guid>
      <dc:creator>rasmusborgstrøm</dc:creator>
      <dc:date>2010-11-10T19:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cancel close form</title>
      <link>https://community.esri.com/t5/arcpad-questions/cancel-close-form/m-p/267337#M1945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Rasmus, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found something similar to this code on the forums or a developer's sample or somewhere a while ago, and have been using it ever since. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Call this sub from the "onQueryCancel" event of each page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub OnFormCancel 
 Dim bResult
 bResult = Application.MessageBox ("Are you sure you want to cancel?", apYesNo, "Cancel?")
 If bResult = apNo Then
&amp;nbsp; ThisEvent.Result = False
 End If
 If bResult = apYes Then
&amp;nbsp; ThisEvent.Result = True
 End If
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:06:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/cancel-close-form/m-p/267337#M1945</guid>
      <dc:creator>EricHajek1</dc:creator>
      <dc:date>2021-12-11T13:06:31Z</dc:date>
    </item>
  </channel>
</rss>

