
494 N.W.2d 245 (1992)
Carla PAPPAS, Individually and as Conservator for Chris Pappas, A Minor Child, and as Executrix of the Thaddeus Chris Pappas Estate, Appellants,
v.
John P. CLARK, D.O.; Wendy Levis, R.Ph.; Bauder Pharmacy, Inc.; Drugtown, Inc.; Dot Discount Drugs # 19-7901 a/k/a Walmart Stores; Foods, Inc. d/b/a Foods, Inc., Dahl's Pharmacy; Drug Marts Incorporated; and Kiburz Drug, Inc., Appellees.
No. 91-1456.
Court of Appeals of Iowa.
October 27, 1992.
*246 Stephen D. Lombardi of Lombardi Law Firm, Des Moines, for appellants.
Thomas Logan and Anne L. Clark of Hopkins & Huebner, P.C., Des Moines, for appellee Foods Inc., d/b/a Dahl's Pharmacy.
Edward N. McConnell of Babich & Nickerson, Des Moines, for appellees Bauder Pharmacy, Drug Marts, and Kiburz Drug.
Glenn Goodwin, Thomas A. Finley and Steven Scharnberg of Duncan, Jones, Riley & Finley, Des Moines, for appellee John Clark.
William L. Chaplin of Bradshaw, Fowler, Proctor & Fairgrave, Des Moines, for appellees Wendy Levis and Drugtown.
Joseph Barron and Roland D. Peddicord of Peddicord, Wharton, Thune, Foxhoven & Spencer, P.C., Des Moines, for appellee DOT Discount Drugs.
Heard by DONIELSON, P.J., HAYDEN, J., and KEEFE, Senior Judge.[*]
DONIELSON, Presiding Judge.
Carla Pappas appeals from a district court order granting the defendants' motion for summary judgment and dismissing her professional negligence claim against them.
On January 28, 1989, Thaddeus Pappas (Thad) was found dead in his home. The cause of death was a self-injected lethal dose of cocaine. That had been a cocaine addict for several years, and he was survived by his wife, Carla, and a minor son, Chris.
Prior to his death, Thad had worked for doctors as a self-employed computer billing expert. During this period, he began to illegally obtain various prescription drugs from numerous Iowa pharmacies. He obtained these drugs by either forging doctors' signatures or by misrepresenting himself to be a doctor over the phone. However, none of these drugs contained cocaine and none appeared in Thad's body at the time of his death.
In January 1991, Carla filed this petition seeking damages for herself and her son arising out of her husband's death. She claimed Dr. Clark should have recognized Thad's condition and made an effort to treat it. Carla claimed Wendy Levis, a pharmacist at HyVee who had discovered Thad was improperly obtaining prescriptions, failed to alert other pharmacies about Thad's illegal activities. Carla also claimed the other pharmacies failed to adequately check Thad's requests for prescriptions. As a result, Carla contends Thad became addicted to prescription drugs and cocaine and ultimately this addiction caused his death.
The defendants filed motions for summary judgment. The district court agreed with the defendants and dismissed Carla's *247 petition. The court ruled Carla was barred from recovering from the defendants, based on the illegal conduct of her husband. The court further ruled the defendants' actions were not the proximate cause of Thad's death due to a cocaine overdose. Carla now appeals.
Our scope of review is for errors at law. Iowa R.App.P. 4. Summary judgment is appropriate only if there exists no genuine issue of material fact. Farm Bureau Mut. Ins. Co. v. Milne, 424 N.W.2d 422, 423 (Iowa 1988). The moving party has the burden to show the nonexistence of a material fact. Id. The evidence must be viewed in the light most favorable to the nonmoving party. Thorp Credit, Inc. v. Gott, 387 N.W.2d 342, 343 (Iowa 1986). This procedure is functionally akin to a directed verdict, and every legitimate inference that reasonably can be deduced from the evidence should be afforded the nonmoving party. Id. A fact issue is generated if reasonable minds can differ on how the issue should be resolved. Id. If the conflict in the record consists only of legal consequences flowing from undisputed facts, entry of summary judgment is proper. Milne, 424 N.W.2d at 423.
I. Thad's Illegal Conduct. Carla first contends the district court erred in determining Thad's illegal conduct in causing his death barred her cause of action.
We agree with the district court. Carla's claims are barred by the public policy of the State of Iowa which generally denies relief to those injured in whole or in part because of their own illegal acts. In Cole v. Taylor, 301 N.W.2d 766 (Iowa 1981), the supreme court barred a cause of action brought by Cole which alleged her psychiatrist had negligently failed to prevent her from committing first-degree murder. The supreme court recognized the policy:
The general rule is: that a person cannot maintain an action if, in order to establish his cause of action, he must rely, in whole or in part, on an illegal or immoral act or transaction to which he is a party, or to maintain a claim for damages based on his own wrong or caused by his own neglect, ... or where he must base his cause of action, in whole or in part, on a violation by himself of the criminal or penal laws ....
Cole v. Taylor, 301 N.W.2d 766, 768 (Iowa 1981) (citing 1 C.J.S. Actions § 13 pp. 996-97).
The court in Cole also barred the same cause of action brought by Cole's husband for loss of consortium. Id. The court held his cause of action must also be dismissed for the same public policy reasons which mandated dismissal of Cole's claim. Id.
Here, Thad's conduct in fraudulently obtaining prescriptions from the defendant pharmacies and in using illegal drugs, including but not limited to his self-injected overdose of cocaine which caused his death, constitutes an illegal act to which he was a party. Such conduct was a clear violation of Iowa Code section 204.403(1)(c) (1989), which states:
1. It is unlawful for any person knowingly or intentionally: ...
c. To acquire or obtain possession of a controlled substance by misrepresentation, fraud, forgery, deception or subterfuge.
Iowa Code § 204.403(1)(c) (1989). See also Iowa Code § 204.401(3) (1989) (regarding unlawful possession of a controlled substance). As it is undisputed that Thad engaged in these activities, the trial court correctly found Carla was barred from bringing this particular cause of action.
In addition, we do not agree the above illegal conduct merely constitutes contributory negligence. We adopt the rationale of Barker v. Kallash, 63 N.Y.2d 19, 468 N.E.2d 39, 479 N.Y.S.2d 201 (1984), which stated:
At the outset a distinction must be drawn between lawful activities regulated by statute and activities which are entirely prohibited by law. In the first instance, it is familiar law that a violation of a statute governing the manner in which activities should be conducted, would merely constitute negligence or contributory negligence.... Such cases would today be resolved under the rule of comparative negligence.... However, *248 when the plaintiff has engaged in activities prohibited, as opposed to merely regulated, by law, the courts will not entertain the suit if the plaintiff's conduct constituted a serious violation of the law and the injuries for which he seeks recovery were the direct result of that violation. In this latter instance recovery is denied, not because the plaintiff contributed to his injury, but because the public policy of this State generally denies judicial relief to those injured in the course of committing a serious criminal act.
Barker, 63 N.Y.2d at 24, 468 N.E.2d at 41, 479 N.Y.S.2d at 203 (citations omitted).
Carla argues our result would be inconsistent with the supreme court's holding in Katko v. Briney, 183 N.W.2d 657 (Iowa 1971). In Katko, the plaintiff had plead guilty to breaking and entering the defendant's abandoned home. He then filed suit against the defendant homeowner for the injuries he suffered from the homeowner's spring gun. Id. On appeal, the supreme court upheld a jury verdict in favor of the plaintiff.
We find Katko can be distinguished from the Cole case and from these facts. In Katko, the main thrust of the defendant's defense in the trial court and on appeal was that Iowa law permitted the use of a spring gun in protecting one's dwelling. Id. at 659. The issue of whether the plaintiff's cause of action would be precluded for public policy reasons was never even addressed in the supreme court's opinion.
Therefore, as a matter of public policy, we hold Carla cannot recover for any injury Thad suffered as a direct result of his own criminal violations.
We recognize Carla's cause of action against the defendant pharmacies and Wendy Levis differs from the cause of action against Dr. Clark. Carla contends Wendy Levis negligently failed to alert the other pharmacies about Thad's conduct, and the other pharmacies failed to adequately check Thad's requests for prescriptions. In her cause of action against Dr. Clark, Carla contends he should have recognized Thad's condition and made an effort to treat it. She claims Dr. Clark's failure to adequately treat Thad's drug addiction resulted in Thad's death. However, because both causes of action are based upon Thad's illegal conduct, we hold Carla is barred from bringing either claim.
II. Proximate Cause of Thad's Death. Carla next contends the district court erred in finding the conduct of the defendants was not a proximate cause of the death of the decedent as a matter of law.
Because we find Carla cannot recover on either of her claims on grounds of public policy, it is not necessary to rule on whether the conduct of the defendants was a proximate cause of Thad's death as a matter of law. We will affirm the district court if any reason for affirmance appears in the record. See Hunter v. City of Des Moines, 300 N.W.2d 121, 126 (Iowa 1981); Kelly v. Brewer, 239 N.W.2d 109, 113 (Iowa 1976).
We affirm the judgment of the district court dismissing Carla's cause of action.
The costs of this appeal are taxed to Carla.
AFFIRMED.
NOTES
[*]  Senior Judge from the 1st Judicial District serving on this court by order of the Iowa Supreme Court.
