<?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 Forms saving null values as string in integer field in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266610#M1936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original tweet: be nice if this form stopped saving stuff as a string (actually it's null) in my integer field. ???#arcpad??? ???#vbscript???&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;found by @ArcPadTeam, replied: RT @geonrd: Can you post some more detail on the ???#ArcPad??? forum, maybe we can help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new at using this product so bear with me as I am not yet accustomed to the terminology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a VBScript that I am using from awhile back that is used for validation of forms. The particular form field is designed to fill in a short integer field in shapefile. The VBscript's validation is written so that (in pseudocode): "if the checkbox is checked, and the value entered is not more than 0, raise alert" Basically it is a checkbox, and next to it is a text field where the user types a number. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens: when the checkbox is *not* checked and the text field has nothing in it, and I continue to the end, hit OK, I get an error saying Type Mismatch. The form appears to be saving a empty string into the short integer field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My workaround: on the Values tab, I enter 0 for default value and 0 as minimum value. Error message stops.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I think: zero should not have be entered. null should be entered. zero implies it has been inspected and reported, when that is not the case. and, I couldn't figure out where to change the Type to Integer (couldn't get CInt to work), instead of it saving a string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for listening.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2012 11:50:35 GMT</pubDate>
    <dc:creator>RyanMendieta</dc:creator>
    <dc:date>2012-06-29T11:50:35Z</dc:date>
    <item>
      <title>Forms saving null values as string in integer field</title>
      <link>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266610#M1936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original tweet: be nice if this form stopped saving stuff as a string (actually it's null) in my integer field. ???#arcpad??? ???#vbscript???&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;found by @ArcPadTeam, replied: RT @geonrd: Can you post some more detail on the ???#ArcPad??? forum, maybe we can help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new at using this product so bear with me as I am not yet accustomed to the terminology.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a VBScript that I am using from awhile back that is used for validation of forms. The particular form field is designed to fill in a short integer field in shapefile. The VBscript's validation is written so that (in pseudocode): "if the checkbox is checked, and the value entered is not more than 0, raise alert" Basically it is a checkbox, and next to it is a text field where the user types a number. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens: when the checkbox is *not* checked and the text field has nothing in it, and I continue to the end, hit OK, I get an error saying Type Mismatch. The form appears to be saving a empty string into the short integer field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My workaround: on the Values tab, I enter 0 for default value and 0 as minimum value. Error message stops.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I think: zero should not have be entered. null should be entered. zero implies it has been inspected and reported, when that is not the case. and, I couldn't figure out where to change the Type to Integer (couldn't get CInt to work), instead of it saving a string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for listening.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 11:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266610#M1936</guid>
      <dc:creator>RyanMendieta</dc:creator>
      <dc:date>2012-06-29T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Forms saving null values as string in integer field</title>
      <link>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266611#M1937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;today I learned that shapefiles cannot store null values. :mad:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2012 15:29:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266611#M1937</guid>
      <dc:creator>RyanMendieta</dc:creator>
      <dc:date>2012-07-02T15:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Forms saving null values as string in integer field</title>
      <link>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266612#M1938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ryan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below I have written a quick test for you. This checks for the two scenarios you mentioned. Null should be allowed as a value in the shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This routine is being called on the Pages onValidate event:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub CheckNumber
Dim objPage
Set objPage = ThisEvent.Object
Dim objChkBox
Set objChkBox = objPage.Controls("Check1")
Dim objTxtBox
Set objTxtBox = objPage.Controls("Edit1")

If (objChkBox.Value = False) And (objTxtBox.Value = "") Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisEvent.Result = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisEvent.MessageText = "Please add a value to the text box &amp;gt; 0"
ElseIf (objChkBox.Value = True) And (objTxtBox.Value &amp;lt; 0) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisEvent.Result = False
&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisEvent.MessageText =&amp;nbsp;&amp;nbsp;&amp;nbsp; "Raise the alert!"
End If


End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how you go.&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;Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:05:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/forms-saving-null-values-as-string-in-integer/m-p/266612#M1938</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2021-12-11T13:05:36Z</dc:date>
    </item>
  </channel>
</rss>

