<?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 Disabling the 'OK' button in a form in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479041#M3430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a custom form of several pages where users are continually entering data on the first page only and then exiting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know of a way of disabling the OK button until users reach the end of the form?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Aug 2010 01:35:14 GMT</pubDate>
    <dc:creator>SteveH</dc:creator>
    <dc:date>2010-08-13T01:35:14Z</dc:date>
    <item>
      <title>Disabling the 'OK' button in a form</title>
      <link>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479041#M3430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a custom form of several pages where users are continually entering data on the first page only and then exiting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know of a way of disabling the OK button until users reach the end of the form?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 01:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479041#M3430</guid>
      <dc:creator>SteveH</dc:creator>
      <dc:date>2010-08-13T01:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the 'OK' button in a form</title>
      <link>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479042#M3431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Stephen, I don't know about disabling the OK button, but you can catch users hitting the OK button and dump them back to the form using something like this:&lt;/SPAN&gt;&lt;BR /&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?")
&amp;nbsp; 
 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;This was in the onquerycancel events of all of my pages so that if a user hits cancel, they get asked if they really mean it. You could do the same thing with the onOK event, asking if they really mean to hit OK. For a reason that escapes me right now I think you have to do it on each page, rather then on the form level. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively you could check variables on each of the pages using the onvalidate event, and by writing a Sub that checks the variables on each page, make sure that the user cannot exit until the required fields are entered and error checked, as seen below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub ValidateUserPTwo
 Dim objPg
 Set objPg = ThisEvent.Object

 If objPg.Controls("cboDP").value = "" Then
&amp;nbsp; ThisEvent.Result = False
&amp;nbsp; ThisEvent.MessageText = "You must select a Discharge Point Layer to Continue"
&amp;nbsp; ThisEvent.MessageType = apOKOnly + apExclamation
&amp;nbsp; Exit Sub
 End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisEvent.Result = True
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So for instance, this forces the user to select a Discharge Point Layer. If the value of that combo box isn't empty, it falls through and hits ThisEvent.Result = True, allowing the page to be validated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479042#M3431</guid>
      <dc:creator>EricHajek1</dc:creator>
      <dc:date>2021-12-11T21:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling the 'OK' button in a form</title>
      <link>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479043#M3432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Eric&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;that second script was just what I was looking for.:cool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 02:23:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/disabling-the-ok-button-in-a-form/m-p/479043#M3432</guid>
      <dc:creator>SteveH</dc:creator>
      <dc:date>2010-08-17T02:23:09Z</dc:date>
    </item>
  </channel>
</rss>

