Dim Counter As Long
Dim rs as Object
Counter = DCount("*", "tblContractors", "ContractorName = Forms![frmAddContractor]!ContractorName")
If Counter > 0 Then
If MsgBox ("This Contractor already exists, Do you want to view details. ", vbExclamation + vbYesNo) = vbYes then
Set rs =...