Hi
I want the delete confirm dialog to appear when the user wants to delete a record.
This is the code I thought would work, but it doesn't:
Code:
Public aktWert as String
'all other variables are controls
Private Sub cmdIO()
DoCmd.SetWarnings True
Set rsTab = CurrentDb.OpenRecordset("INT03-Team", dbOpenDynaset)
rsTab.FindFirst "Kürzel = '" & Me.KürzelAuswahl & "'"
aktWert = Me.KürzelAuswahl
rsTab.Delete
rsTab.Close
Set rsTab = Nothing
End Sub
Private Sub Form_AfterDelConfirm(Status As Integer)
DoCmd.SetWarnings False
If Status <> acDeleteOK Then Exit Sub
Call Log_Eintrag("INT03-Team", "Löschung", aktWert, "Satz")
mTxt = "Der User mit Kürzel »" & aktWert & "« wurde gelöscht."
MsgBox mTxt, vbOKOnly, mTit
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
Maybe the rsTab.Delete command is not at the right place? But how do I trigger the dialog?
Or is it possible, that the deletion confirm dialog can only be used when deleting from a datasheet?
Thanks for your answers,
Walter