Dim db As dao.Database
Dim Response As Integer
Set db = CurrentDb()
Response = MsgBox("Do you want to delete this record ? ", vbYesNo)
If Response = No Then
Cancel = True
Else
If DCount("part_nod_cin", "tbl_Participant_NOD", "part_nod_cin= '" + Me.frm_part_cin + "'") > 0 Then
Cancel = True
Else
If DCount("part_cin", "tbl_Participant", "part_cin ='" + Me.frm_part_cin + "'") = 1 Then
db.Execute "Insert into tbl_delete(part_table,part_del_participant) values ('" & Me.RecordSource & "' ,'" & Me.frm_part_cin & "')"
End If
End If
End If
participant_NOD ( Linked table) checking whether that table has got any records of that participant.