M
Michelle
I have the following code connected to a command button that is used to
delete a record ... It gives me an error Run-time error '3021': No current
record.
This is on a form that is pulled from query where you enter the key # it
bring the key up you can then either edit the information for that key or
delete it.
Also it errors out at " DoCmd.RunCommand acCmdDeleteRecord"
Private Sub Command4_Click()
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "Are You Sure You Want To Delete This Record?"
TitleStr = "Confirm Delete Record"
If MsgBox(MsgStr, vbYesNo, TitleStr) = vbNo Then
Exit Sub
End If
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End Sub
delete a record ... It gives me an error Run-time error '3021': No current
record.
This is on a form that is pulled from query where you enter the key # it
bring the key up you can then either edit the information for that key or
delete it.
Also it errors out at " DoCmd.RunCommand acCmdDeleteRecord"
Private Sub Command4_Click()
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "Are You Sure You Want To Delete This Record?"
TitleStr = "Confirm Delete Record"
If MsgBox(MsgStr, vbYesNo, TitleStr) = vbNo Then
Exit Sub
End If
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End Sub