smtazulislam
Member
- Local time
 - Today, 12:57
 
- Joined
 - Mar 27, 2020
 
- Messages
 - 808
 
Hello, 
I have a DELETE button in the continuous form which name fromEmployeeVacationSubform. Today someone operate my DB and delete some important data. So, I want If user try to delete data then form required user password (Which password he access this database) for confirmed.
Here I try to One SQL and Without SQL.
	
	
	
		
Password form name is frmDeleteDataPass.
Advance thanks and appreciate for help....
 I have a DELETE button in the continuous form which name fromEmployeeVacationSubform. Today someone operate my DB and delete some important data. So, I want If user try to delete data then form required user password (Which password he access this database) for confirmed.
Here I try to One SQL and Without SQL.
		Code:
	
	
	Private Sub cmdDelete_Click()
Dim StrSQL As String
If MsgBox("Are you sure you want to DELETE " & Me.VacationID & "?", vbCritical + vbYesNo, "Delete") = vbYes Then
    StrSQL = "DELETE * FROM tblEmployeeVacation WHERE VacationID = " & Me.VacationID
    CurrentDb.Execute StrSQL
Else
    DoCmd.RunCommand acCmdUndo
End If
    Me.Requery
    
'    If MsgBox("Are you sure you want to DELETE? ", vbCritical + vbYesNo, "Delete") = vbYes Then
'        DoCmd.RunCommand acCmdDeleteRecord
'    Else
'        DoCmd.RunCommand acCmdUndo
'    End If
End Sub
	Password form name is frmDeleteDataPass.
Advance thanks and appreciate for help....