That doesn't seem like an efficient way to debug, but I guess that is the best option when using ArcPad Studio. Anyways, here is my code if anyone can help figure it out. Basically after a user Identifies a piece of Sewer, a form pops up with some fields to populate. When they hit save, this is what happens. The msgbox near the end will only show itself the first time, then never again for subsequent save actions. This is in the shapefile script.sub SaveJetting
dim facilityID, fromMH, toMH, length, diameter, material, gridNo, rodded, dragged, flushed, photoed, pluggedMain, footage, municipality, depot
'take all the fields on the Jetting Form and assign them to a variable
set facilityID = layer.forms("frmJetting").pages("Page1").controls("txtFacilityID")
set fromMH = layer.forms("frmJetting").pages("Page1").controls("txtFrom")
set toMH = layer.forms("frmJetting").pages("Page1").controls("txtTo")
set length = layer.forms("frmJetting").pages("Page1").controls("txtLength")
set diameter = layer.forms("frmJetting").pages("Page1").controls("txtDiameter")
set material = layer.forms("frmJetting").pages("Page1").controls("txtMaterial")
set gridNo = layer.forms("frmJetting").pages("Page1").controls("txtGridNo")
set rodded = layer.forms("frmJetting").pages("Page1").controls("chkRodded")
set dragged = layer.forms("frmJetting").pages("Page1").controls("chkDragged")
set flushed = layer.forms("frmJetting").pages("Page1").controls("chkFlushed")
set photoed = layer.forms("frmJetting").pages("Page1").controls("chkPhotoed")
set pluggedMain = layer.forms("frmJetting").pages("Page1").controls("chkPluggedMain")
set footage = layer.forms("frmJetting").pages("Page1").controls("chkFootage")
set municipality = layer.forms("frmJetting").pages("Page1").controls("txtMuni")
set depot = layer.forms("frmJetting").pages("Page1").controls("txtDepot")
'use the ArcPad 'DataPath' as the path to all the files that need to be edited
Dim inpath, datestring
inpath = Preferences.Properties("DataPath")
Dim rs
'THIS IS TO WRITE TO THE DBF
Set rs = Application.CreateAppObject("Recordset")
Call rs.Open(inpath & "\JETTING.dbf", 2)
rs.addnew
rs.fields("FACID").value = facilityID.value
rs.fields("JETDATE").value = day(date) & "/" & month(date) & "/" & year(date)
rs.fields("JETTIME").value = FormatDateTime(now(), 3)
rs.fields("FROMMH").value = fromMH.value
rs.fields("TOMH").value = toMH.value
rs.fields("LENGTH").value = length.value
rs.fields("DIAMETER").value = diameter.value
rs.fields("MATERIAL").value = material.value
rs.fields("GRIDNO").value = gridNo.value
rs.fields("RODDED").value = rodded.value
rs.fields("DRAGGED").value = dragged.value
rs.fields("FLUSHED").value = flushed.value
rs.fields("PHOTOED").value = photoed.value
rs.fields("PLUGGED").value = pluggedMain.value
rs.fields("FOOTAGE").value = footage.value
rs.fields("SANSTORM").value = "SAN"
rs.fields("MUNI").value = municipality.value
rs.fields("DEPOT").value = depot.value
rs.Update
rs.Close
set rs = nothing
'**************************
'this will update the shapefile DBF in order to change the symbology
Set rs = Application.CreateAppObject("Recordset")
Call rs.Open ("H:\DSM Applications\Jetting Card\GISADMIN_GravitySewer.dbf", 2) '(inpath & "\GISADMIN_GravitySewer.dbf", 2)
'search for the current records FacilityID
dim dbfQuery, editRecord
dbfQuery = "[FACILITYID] = """ & facilityID.value & """"
editRecord = rs.find(dbfQuery)
'edit the record by adding the current date to the JETTED field
if (editRecord > 0) then
rs.movefirst
rs.move(editRecord - 1)
rs.fields("JET").value = day(date) & "/" & month(date) & "/" & year(date)
rs.Update
rs.Close
end if
set rs = nothing
'msgbox "Hit the Refresh Button to update Symbology."
layer.forms("frmJETTING").close
end sub
What I am noticing is that after a user hits the 'Refresh' button I have created (allows the map to update it's symbology) then msgbox will show up the next time the user hits Save. Here is the code for the refresh button. It basically closes and opens the apm again. This is in an apa.sub refresh
dim inpath
inpath = Preferences.Properties("DataPath")
if gps.isopen = True then
application.map.save(inpath & "\" & "Inspections.apm")
application.map.clear
application.map.open(inpath & "\" & "Inspections.apm")
Application.ExecuteCommand("gpsenable")
else
application.map.save(inpath & "\" & "Inspections.apm")
application.map.clear
application.map.open(inpath & "\" & "Inspections.apm")
End If
end sub