Confirm delete "No"

katekaew

Registered User.
Local time
Today, 07:02
Joined
Jan 19, 2005
Messages
19
I use datasheetview, when I want to delete the record I just select the row and press delete button and click "yes". However, when I click "no" (means I don't want to delete) the record is disappeared.

I create refresh button to Requery and Refresh the form but the record still not comes up. I have to close and open my form every time.

Any suggestion would be very appreciated.
 
Last edited:
I'm using Access 2002. I also tried Forms!frmMain!frmSubForm.Requery. It still doesn't work.
 
Post a copy of your database. Did you try the docmd.runcommand accmdrefresh? If not try that on the after update or on Current event.
 
My DatasheetView is on frmSubStrCSA

Private Sub Combo_AfterUpdate()
Forms!frmStrWeakCSA!frmSubStrCSA.Requery
End Sub

I tried:
on frmSubStrCSA
Private Sub Form_AfterUpdate()
Me.Refresh
End Sub

Private Sub Form_Current()
Me.Refresh
End Sub

I also tried:
Private Sub Form_Current()
DoCmd.RunCommand acCmdRefresh
End Sub

But it still doesn't work.
 
Last edited:
Use the BeforeDeleteConfirm event.

i.e.

Code:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
    If MsgBox("Are you sure you want to delete this record?", _
        vbQuestion + vbYesNo, "Delete Employee?") = vbNo Then
        Cancel = True
    End If
End Sub ' Form_BeforeDelConfirm
 
It's so strange!!! I try to delete the first record when I click "No" the record doesn't dissappear but when I try to delete the second record and click "No" the record does dissappear.

SJ, I also tried yours but the result is the same.
 
Ar~~ I found a little mistake, It works fine now. Thanks you guys!
 

Users who are viewing this thread

Back
Top Bottom