tigergirl > 20-08-12, 12:01 PM
Cafe Via He > 22-08-12, 11:14 AM
Private Sub cmdXoakythi_Click()
Dim so_mon_thi As Integer
so_mon_thi = DCount("[MA_KY_THI]", "KY_THI_CO_MON_THI", "MA_KY_THI='" & [Gridkythi].Form![MA_KY_THI] & "'")
If so_mon_thi > 0 Then
MsgBox "Khong the xoa vi ky thi nay da co mon thi "
ElseIf MsgBox("Ban co muon xoa mau tin nay khong?", vbYesNo + vbQuestion, "Thong bao") = vbYes Then
DoCmd.SetWarnings False
'DoCmd.RunCommand acCmdDeleteRecord
CurrentDb.Execute "DELETE FROM KY_THI " & _
"WHERE MA_KY_THI = '" & [Gridkythi].Form![MA_KY_THI] & "'"
DoCmd.GoToRecord , , acLast
Forms!DSkythimonthi!Gridkythi.Requery
End If
End Sub
tigergirl > 22-08-12, 12:18 PM