How find matched record and alert?

How find matched record and alert?

I want users to fill out a form but if there is a match between the data they enter and exisitng data in the database I want the user alerted (by email). The email needs to contain the matched data as well as the Case_Code value from the matched database record.
 
How would I do this? I tried my luck at this but it doesn't work,
 

if Case_Management_form(Case_Name == input.Case_Name && input.Case_Name != "") || (Adverse_Party == input.Adverse_Party && input.Adverse_Party != ""

email_body = "Possible conflict with" + input.Case_Name + "with exisitng record" + Case_Code