The DeleteRecord method is a private subroutine in the Critique component, called by the DeleteCritiqueByCritiqueNo and DeleteCritiqueByObjectID methods, that deletes a record in the Critique table of the FmLib database.
The delete operation is performed by opening an ADODB recordset (oRs), assigning the Filter parameter passed to the method to the Filter property of oRs, and executing the Delete method of the oRs recordset. The Filter parameter contains the value of one of two variables:
oRs.Filter = Filter
oRs.Open "Critique", Me.ConnectionString, adOpenStatic, adLockOptimistic, adCmdTableDirect
The constant Approved, which contains the value 1, is compared to the isApproved value in the oRs recordset. If the critique is approved (isApproved = 1) and the value of the IsApprover parameter, passed to the DeleteRecord method, is 1 the critique record is deleted.
If Not oRs.EOF Then
' Only delete if critique has been approved
If IsApprover Or Approved = oRs("isApproved") Then
oRs.Delete
End If
End If
The complete code for the DeleteRecord method is available in Critique.cls Server-Side COM Component in the code section.