this is the code that is executed when i click the delete record button
'------------------------------------------------------------
' DeleteGroup1
'
'------------------------------------------------------------
Function DeleteGroup1()
On Error GoTo DeleteGroup1_Err
DoCmd.OpenForm "ChangeGroup", acNormal, "", "[group]=[Forms]![Groups]![group]", , acNormal
DoCmd.Close acForm, "Groups"
Call Setwarningoff
DoCmd.RunCommand acCmdDeleteRecord
Call Setwarningon
DoCmd.Close acForm, "ChangeGroup"
DeleteGroup1_Exit:
Exit Function
DeleteGroup1_Err:
MsgBox Error$
Resume DeleteGroup1_Exit
End Function
then when the this is the code that is executed wehn the ondelete event is triggered
'------------------------------------------------------------
' ConfirmDelete
'
'------------------------------------------------------------
Function ConfirmDelete()
On Error GoTo ConfirmDelete_Err
If (MsgBox("Do you want to delete this record?", 273, "Confirm Delete") <> 1) Then
DoCmd.CancelEvent
Exit Function
End If
SendKeys "{Enter}", False
ConfirmDelete_Exit:
Exit Function
ConfirmDelete_Err:
MsgBox Error$
Resume ConfirmDelete_Exit
End Function
thanks