<?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: How to programatically refresh a combobox listtable? in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169006#M1205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had been thinking of a work around all weekend to this problem so I came into the office with a way of resolving this problem, fired up help and was just doing some casual searching when I spotted &lt;/SPAN&gt;&lt;STRONG&gt;AddItemsFromTable&lt;/STRONG&gt;&lt;SPAN&gt;. So during design time we have a property of the ComboBox called listtable but during runtime it's called AddItemsFromTable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my apologies to all for asking this question as I'm not used to objects having different names for the same property...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code is below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub PopulateCombobox

' Get file path of APM file then use this to create a path to dBase file
Dim fp
fp = MAP.FilePath
Dim i
i = instrrev(fp,"\")
fp = left(fp,i) &amp;amp; "SpeciesList.dbf"


' Get control and refresh 
Dim p
Set p = ThisEvent.Object
Dim c
Set c = p.Controls
Dim sc
Set sc = c.Item("cmbxSpecies")
sc.Clear
sc.AddItemsFromTable fp,"Species","Species" 
End Sub

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:08:13 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-12-12T16:08:13Z</dc:date>
    <item>
      <title>How to programatically refresh a combobox listtable?</title>
      <link>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169005#M1204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having real problems with this one and was hoping someone out there could help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a form with 3 pages, page 2 has a combobox on it where I have set the listtable to be a dbf file at design time. Page 3 has the ability to append a new entry to the end of the dbf file (This bit of code works fine). I want to be able to see this new entry if I tab back to page 2. I cannot seem to find any method that refreshes the combobox, is it possible? I've tried setting the listtable property of the combobox but it keeps bombing out saying that it's not a property...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;below is the code that is called by an onclick button event on page 3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas, I'm using Arcpad 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub NewSpecies
' Description: Appends a new species to dbf file
'
' Created: 9/9/11

' Get species name
dim b
Set b = ThisEvent.Object
dim p
set p = b.Parent
dim c
set c = p.Controls
dim t
set t = c.Item("ebxNew")
dim s
s = t.Text
If s = "" then
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox "You must set the species name first!", vbExclamation, "Invalid species name..."
&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
End If

' Get file path of APM file then use this to create a path to dBase file
dim fp
fp = MAP.FilePath
dim i
i = instrrev(fp,"\")
fp = left(fp,i) &amp;amp; "SpeciesList.dbf"

' Open dBase file
Dim rs
set rs = APPLICATION.CreateAppObject("RecordSet")
rs.Open fp,2

' Find out what is the last ID and increment by 1
rs.MoveLast
dim id
id = rs.Fields.Item("ID").Value
id = id + 1

' Add new species
rs.AddNew
rs.Fields.Item("ID").Value = id
rs.Fields.Item("Species").Value =&amp;nbsp; s
rs.Update

' Refresh combobox
dim cb
set cb = p.Parent.Pages("PAGE2").Controls.Item("cmbxSpecies")
msgbox cb.Name
set cb.listtable = "SpeciesList.dbf" '&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; This does not work
cb.listtable = "SpeciesList.dbf" '&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; nor does this!
Msgbox "Species " &amp;amp; s &amp;amp; " successfully added to list!",vbInformation,"List updated!"

End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169005#M1204</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically refresh a combobox listtable?</title>
      <link>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169006#M1205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had been thinking of a work around all weekend to this problem so I came into the office with a way of resolving this problem, fired up help and was just doing some casual searching when I spotted &lt;/SPAN&gt;&lt;STRONG&gt;AddItemsFromTable&lt;/STRONG&gt;&lt;SPAN&gt;. So during design time we have a property of the ComboBox called listtable but during runtime it's called AddItemsFromTable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my apologies to all for asking this question as I'm not used to objects having different names for the same property...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code is below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Sub PopulateCombobox

' Get file path of APM file then use this to create a path to dBase file
Dim fp
fp = MAP.FilePath
Dim i
i = instrrev(fp,"\")
fp = left(fp,i) &amp;amp; "SpeciesList.dbf"


' Get control and refresh 
Dim p
Set p = ThisEvent.Object
Dim c
Set c = p.Controls
Dim sc
Set sc = c.Item("cmbxSpecies")
sc.Clear
sc.AddItemsFromTable fp,"Species","Species" 
End Sub

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:08:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169006#M1205</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T16:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically refresh a combobox listtable?</title>
      <link>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169007#M1206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I may be wrong but listtable will fill the combobox with initial values but additemsfromtable will add more entries to the combobox to the ones already there. Both use a table (.dbf) as a source.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rolf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 05:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/how-to-programatically-refresh-a-combobox/m-p/169007#M1206</guid>
      <dc:creator>RolfBroch</dc:creator>
      <dc:date>2011-09-13T05:10:52Z</dc:date>
    </item>
  </channel>
</rss>

