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
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
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.