I've created a button on an editform to delete the selected feature. Here's the code that is called when the button is clicked:
Sub DeleteSighting
Dim objSightingsLayer
Dim objSelectedLayer
Set objSelectedLayer = Map.SelectionLayer
if objSelectedLayer is Nothing then
msgBox("No feature is selected!")
exit Sub
else
Set objSightingsLayer = map.layers("Sightings")
objSightingsLayer.Forms("EditForm").Close
Application.ExecuteCommand("featuredelete")
end if
End Sub
When I click the button, the form closes, and the ArcPad dialog box asks me if I want to delete the selected feature. However, when I say "yes," the feature is not deleted, and it becomes unselected. If I select the feature and then use the "Delete Feature" command from the drawing tools menu, the feature is deleted as expected. Any idea why the "delete feature" command doesn't work from my edit form?