I cant figure out how to delete a record from a DBF table....I have a few DBF lookup tables with my application that I have code that allows the user to update and create new rows in the DBF table. But now I want to give the user the ability to delete recrods as well...I am tryign this with NO successAny thoughts? Dim objRS3, objSelLayer3, objEFPageOneControls3, objEditForm3
Set objSelLayer3 = Map.SelectionLayer
Set objRS3 = objSelLayer3.Records
objRS3.Bookmark = Map.SelectionBookmark
Set objEditForm3 = application.map.layers("Supports").forms("EDITFORM")
Set objEFPageOneControls3 = objEditForm3.Pages("page3").Controls
' Populate variables to the form controls.
Dim varMUTCD_CODE
varMUTCD_CODE = objEFPageOneControls3("MUTCD_CODE").Value
Dim objForm, objPageControls, rs
Set objForm = EDITFORM
Set objPageControls = objForm.Pages("PAGE3").Controls
Set rs = CreateAppObject("recordset")
rs.Open "C:\GPS_data_collections\StreetSign_Collection_ArcPAD\DBF_Lookup_Files\MUTCD_Code.dbf", 2
'search for the current records MUTCD_Code
dim dbfQuery, editRecord
dbfQuery = "[MUTCD_Code] = """ & varMUTCD_CODE & """"
editRecord = rs.find(dbfQuery)
'edit the record
if (editRecord > 0) then
Dim Answer, MyNote
MyNote = "Are you sure you want to delete this MUTCD Code?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
If Answer = vbNo Then
Exit Sub
Else
rs.movefirst
rs.move(editRecord - 1)
rs.Delete
rs.Update
rs.Close
End If
end if
set rs = nothing