Can anyone help?
My problem is this: I've created a vegetation survey form in ArcPad which contians a subform that I want to export to a dbf file not connected to the shapefile of the main survey form. I can get the subform to open OK and can enter the data, but when I click on a button with a control for exporting the data to a dbf file, I get an error message. I'm at a loss as to what the problem is. The script is below. I get an error message for line 24: "theRS.MoveNext 'moves to last record"
Sub SetID
'Sets the unique ID for each survey
If ThisEvent.Object.Mode = 3 Then
ThisEvent.Object.Pages("General1").Controls("OID").Text = CStr(CLng(DateDiff("s",CDate(#01/01/2005#), Now)))
End If
End Sub
Sub OpenSubFormLandCover
'Opens the Land Cover Form from the Landuse Form
Application.Map.Layers("Landuse").Forms("frmLndCov").Show
End Sub
Sub SaveCloseSubFormLandCover
Set page = editform.pages.item("Lnduse1")
'open the DBF-file
Set theRS = Application.CreateAppObject("RecordSet")
theRS.Open "P:\Work\SSD\Users\Huxtac\ArcPad Stuff\Veg Survey\LandCoverOut.dbf",2
theRS.MoveNext 'moves to last record
theRS.AddNew 'adds a new record
theRS.Fields("OID").Value = layer.Forms("EDITFORM").Pages("General1").Controls("OID")
theRS.Fields("SITE").Value = layer.Forms("EDITFORM").Pages("General1").Controls("Site")
theRS.Fields("DOMUSE").Value = layer.Forms("frmLndCov").Pages("Lnduse1").Controls("CboDomLndUse")
theRS.Fields("UPPER").Value = layer.Forms("frmLndCov").Pages("Lnduse1").Controls("CboLndCovUpp")
theRS.Fields("GROUND").Value = layer.Forms("frmLndCov").Pages("Lnduse1").Controls("CboLndCovGrd")
theRS.Update 'saves information to the recordset
theRS.Close
Set theRS = Nothing
Application.Map.Layers("Landuse").Forms("frmLndCov").Close
End Sub
Does anyone have any ideas