Using Access 2003 (2000 format)
Behind a Delete button on a form, I have the following code
Is there any reason that should no longer work? It used to work.
If I select the record, and click on "Delete Record" from the Edit menu, it works there...but not in this VBA code.
I tried using coding
That doesn't work either. The message I get is "The Delete command is not available now."
Tom
Behind a Delete button on a form, I have the following code
Code:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
Select Case MsgBox(" Do you really wish to" _
& vbCrLf & " DELETE this record?" _
& vbCrLf & "" _
& vbCrLf & "This cannot be undone!" _
, vbYesNo Or vbExclamation Or vbDefaultButton1, "Delete check")
Case vbYes
GoTo DeleteProcess
Case vbNo
Exit Sub
End Select
DeleteProcess:
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Exit_cmdDelete_Click:
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
Is there any reason that should no longer work? It used to work.
If I select the record, and click on "Delete Record" from the Edit menu, it works there...but not in this VBA code.
I tried using coding
Code:
Docmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
That doesn't work either. The message I get is "The Delete command is not available now."
Tom