Dear Gents,
Is there a way to disable disappearing records temporary when i press delete button ?
if i pressed yes delete , then it will be deleted , But if i said don't delete it will restore that record again.
Dear Gents,
Is there a way to disable disappearing records temporary when i press delete button ?
if i pressed yes delete , then it will be deleted , But if i said don't delete it will restore that record again.
No.
once you delete a record its gone. That's why they call it delete.
You could add a field DELETED. Put a button on the form,a 'delete' button ,to mark the record as true, and doesn't show.
disable the delete record property on the form.
then to 'undelete', set the deleted field to false.
Or are you asking for a delete confirmation before the delete?
if i pressed yes delete , then it will be deleted
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Like this
Code:Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer) Response = MsgBox("Do You Want To Delete This Record?", vbCritical + vbYesNo, "You Are About To Delete a Record!") If Response = vbNo Then Cancel = True End If End Sub
Linq ;0)>
I think what he is asking is when you hit delete, it removes the record from view while it asks if you want to delete it. I think he wants to keep it visible until you hit yes/no to delete? If so I think use Missing code and just put an Else Delete command?
Private Sub MyDeleteButton_OnClick(Cancel As Integer, Response As Integer) Response = MsgBox("Do You Want To Delete This Record?", vbCritical + vbYesNo, "You Are About To Delete a Record!")
If Response = vbNo Then
Cancel = TrueElse
DoCmd.SetWarnings FalseEnd If
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End Sub