
282 N.W.2d 890 (1979)
NATIONAL TEXTURE CORPORATION, formerly Clemco, Inc., Respondent,
v.
Richard H. HYMES, Appellant.
No. 48691.
Supreme Court of Minnesota.
August 3, 1979.
*892 Orrin Haugen, Kressel & Cecere, Minneapolis, for appellant.
Merchant, Gould, Smith, Edell, Welter & Schmidt and Alan G. Carlson, Minneapolis, for respondent.
Heard before YETKA, WAHL, and MAXWELL, JJ., and considered and decided by the court en banc.
YETKA, Justice.
This is an appeal from an order of Hennepin County District Court, denying various post-trial motions, including defendant Richard Hymes' motion for disqualification of plaintiff National Texture Corporation's counsel, and from the district court's judgment, holding that National Texture Corporation is the owner of U. S. Patent No. 3,897,577, covering roll-on texture, that Hymes shall assign it to the company, and that Hymes' counterclaim should be dismissed. We reverse and remand.
The questions presented by this appeal are:
1. Did the trial court err in denying Hymes' motion to disqualify plaintiff National Texture Corporation's counsel?
2. Did the trial court err in restricting certain pretrial discovery and in limiting cross-examination of plaintiff's witnesses at trial?
3. Were certain findings of fact clearly erroneous?
4. Were the conclusions of law supported by established precedent?
5. Did the trial court improperly deny Hymes' motion to amend his answer to conform to the evidence adduced at trial, pursuant to Rule 15.02, Rules of Civil Procedure?
National Texture Corporation (National)[1] was started by Mary Rae Clement's husband and father-in-law and eventually specialized in drywall products, textured coatings, and the finishing of sheetrock. After her husband died, Mary Rae continued to run the business. In December 1971, she married Richard Hymes, who was made president of the company and a member of the board of directors.
Hymes was brought into the financially troubled company primarily to improve its financial condition and to plan the business. Prior to that, his business experience included selling auto parts, constructing homes and apartments, and managing and maintaining units in the apartment buildings. He claims that he developed roll-on texture during this time. Shortly before he married Mary Rae, he sold his apartment properties.
*893 While he was president of National, neither he nor Mary Rae received a salary, but withdrew money when it was available. According to Mary Rae, in April of 1973, Hymes was dejected after losing a considerable amount of money in the stock market. She testified that he said he would have to look for employment elsewhere because National could not support both of them. She suggested instead that he try to develop new products and new markets so that the company could support them. As a result, Hymes developed several new products. National asserts that roll-on texture was developed at this time. Roll-on texture is a material that can be applied to ceilings or wall textures by the use of a paint roller. It is designed primarily for the do-it-yourself market. It created a new market for National and by 1974 accounted for about 75 percent to 85 percent of National's business.
In September 1973, Hymes met with a patent attorney from the law firm representing National then and in this action. At the September meeting, Hymes gave the attorney some company literature and also discussed roll-on texture. There was a subsequent meeting on November 29, 1973, at which Hymes, using a company check, gave the attorney a deposit for the patent applications for roll-on texture and another product. When the attorney asked whether Hymes wanted to assign the patent applications, he responded that he did not.
The patent for roll-on texture was initially executed on March 11, 1974. Mary Rae testified that she reviewed a draft of the patent application and saw that Hymes' name and address were on it. When she asked him about this, he allegedly told her that the application must be made out to an individual, but that they both knew the company owned it.
Because the initial draft of the application was mislaid, a substitute application was prepared on April 17, 1974, and again Hymes stated he did not want to assign the patent application. In November of that year the patent office rejected the application and the attorney notified Hymes by mail.
In March 1974, Mary Rae and Hymes drew up an employment agreement that required employees to assign ideas, patent applications, or patents in connection with product development to the company. Most of the employees signed this agreement. Hymes maintains that he did not sign the agreement, although several witnesses contradict his testimony.
During the middle and latter part of 1974, Mary Rae and Hymes' relationship deteriorated as they argued about the management of the business. Because of such disputes, Bruce Pedersen, national sales manager, was elected to the board of directors to act as a tie-breaker. On December 30, 1974, Pedersen and Mary Rae voted to remove Hymes as president, and subsequently removed him from the board.
In January 1975, the attorney contacted National with respect to further patent applications or trade secret considerations concerning roll-on texture. Mary Rae authorized an amendment to the patent application and its further prosecution. This effort proved successful and the application was approved. Hymes telephoned the attorney in April or May 1975 to discuss the roll-on texture patent application and another patent that he was considering, but the attorney declined to advise Hymes because, as the attorney testified, he represented National.
National then brought suit in January 1976 to quiet title and to compel Hymes to convey title to the patent to National. Hymes counterclaimed for damages due to National's representing that it owned the patent and disparaging Hymes' business activities. During pretrial discovery, Hymes attempted to depose the attorney as to discussions he had with the officers of National concerning ownership and royalty rights in the patent. The trial court did not permit such inquiry, finding the matters were protected by the attorney-client privilege.
*894 1. Hymes argues that because the attorney represented him during the patent prosecution and Hymes shared certain confidences and secrets with him, Hymes was prejudiced by the attorney's law firm's representation of National in this suit.
An attorney should not use information he received in the course of representing a client to the disadvantage of that client. In this regard, the attorney should exercise care to prevent disclosure of confidences and secrets of one client to another and decline employment that would require such disclosure. ABA Code of Professional Responsibility EC 4-5. See, also, id. DR 4-101. This obligation to preserve the secrets and confidences imparted by a client continues even after the termination of employment. ABA Code of Professional Responsibility EC 4-6. An attorney should similarly refrain from representing a party in an action against the former client where there is an appearance of a conflict of interest or a possible violation of confidence, even if such may not be true in fact. 2 American Bar Association Committee on Ethics and Professional Responsibility, Informal Ethics Opinions 23 (1975). The purpose for disqualification of an attorney in such situations is to ensure the attorney's absolute fidelity and to guard against inadvertent use of confidential information. Ceramco, Inc. v. Lee Pharmaceuticals, 510 F.2d 268, 271 (2 Cir. 1975).
The test generally applied to determine the existence of a conflict of interest is whether there is a substantial relationship between the subject matters of a pending action and those matters in which the attorney is alleged to have previously represented the client. Redd v. Shell Oil Co., 518 F.2d 311 (10 Cir. 1975); T. C. Theatre Corp. v. Warner Bros. Pictures, 113 F.Supp. 265 (S.D.N.Y.1953). Once the substantial relationship test is met, it will be assumed that confidences bearing on the subject matter of the current representation were disclosed. Richardson v. Hamilton International Corp., 469 F.2d 1382, 1385 (3 Cir. 1972), certiorari denied, 411 U.S. 986, 93 S.Ct. 2271, 36 L.Ed.2d 964 (1973); T. C. Theatre Corp. v. Warner Bros. Pictures, 113 F.Supp. 265, 268 (S.D.N.Y.1953). There is no doubt that the law firm represents interests adverse to Hymes; the primary issue is whether the attorney represented Hymes, the company, or both, during the prosecution of the patent application.
In support of this position Hymes cites the following facts: he spoke with the attorney at various times about the roll-on texture; on three occasions he instructed the attorney that the patent application was to be kept in his (Hymes') name, and the attorney stated at trial that when Hymes contacted him in April or May, 1975, Hymes must have regarded him as Hymes' attorney. Additionally, at the hearing on the motion to quash the taking of the attorney's deposition, the presiding judge stated that there appeared to be serious conflicts between the attorney's relationship to this suit and his being co-counsel and the law firm's continuing representation of National. The judge expressed similar reservations in his subsequent order denying the motion:
"Plaintiff's counsel contends it has represented the plaintiff exclusively. However, one becomes hard pressed to see how plaintiff's counsel can deny any representation of Hymes when there is no dispute about counsel's action in securing the patent for Hymes, regardless of the parties' agreements as to the ultimate vesting or assignment of title after the patent was issued. The [law firm], undeniably did appear on behalf of Hymes at one time [or] another and by virtue of their representation in this action, they sit in somewhat of a precarious position with reference to potential conflicts of interest."
The record also indicates that trial counsel for National was aware that Hymes had repeatedly objected to its representing National, as when counsel for National made *895 these disclosures at a hearing before the trial court:
"* * * But first of all, I will go to the lawsuit with respect to our representation of National Texture in this lawsuit. The existence of the attorney-client privilege is beyond question, and the matter has been resolved by [two other judges].
"Before we ever appeared before those two judges, Hymes had already begun to complain about the fact that our firm was representing National Texture, and [my partner] and myself on behalf of National Texture met with [opposing counsel] on, I believe, December 10, and we discussed the fact that during the deposition, [opposing counsel] asked  had questioned me about our representation of National Texture. He said we represented Mr. Hymes. And, we called a meeting and we told them that we regard this as a serious matter. If you think we should withdraw, we want you to tell us that and we will give it our prompt consideration."
Thus, there is persuasive evidence that the attorney did represent Hymes, that secrets and confidences were given, and that, therefore, the law firm should not have represented National in this dispute. Consequently, in the absence of consent by Hymes to the law firm's representing National, the firm should have voluntarily withdrawn or have been ordered to do so by the trial court. Although counsel for National asserts that no actual conflict existed  an argument the trial judge found difficult to accept, as do we  lawyers should avoid even the appearance of conflict. Hymes repeatedly questioned the propriety of the firm's representation of National and the trial court itself suggested that the firm withdraw.
That the firm should not have handled this suit is further supported by the somewhat analogous case of Novo Terapeutisk Laboratorium A/S v. Baxter Travenol Laboratories, Inc. (7 Cir. 1979), discussed at 607 F.2d 186, where a law firm was disqualified from representing a client because one of its former members, while still with the firm, had consulted with the client's opponent for over two hours on a patent matter substantially related to the current action. The court noted that a confidence could be revealed on a related subject matter in a brief moment without the client even being charged a nickel.
We hold that where a law firm represents a company, and an officer thereof consults the firm in order to apply for a patent in his own name, and a dispute arises after he leaves the company as to whether he or the company owns the patent, the law firm should be disqualified from representing the company, absent consent of both parties.
2. At oral argument before this court, Hymes stated that under his theory of the case, if he had been allowed pretrial discovery and if, at trial, he had been permitted to cross-examine National's witnesses with regard to discussions and correspondence relating to the patent, he could have proved that National intended that the patent be issued in his name and that he was entitled to certain royalties for the use thereof. Hymes was allegedly denied these rights because the attorney-client privilege was invoked by counsel for National.
Under Minn.St. 595.02(2),
"An attorney cannot, without the consent of his client, be examined as to any communication made by the client to him or his advice given thereon in the course of professional duty; nor can any employee of such attorney be examined as to such communication or advice, without the client's consent * * *."
Thus, communications that seek to elicit legal advice from an attorney acting in that capacity, that relate to that purpose, and that are made in confidence by the client are protected from disclosure, unless the privilege is waived. Brown v. St. Paul City Railway, 241 Minn. 15, 33, 62 N.W.2d 688, *896 700 (1954), citing 8 Wigmore, Evidence (3 ed.) § 2292. The purpose of the privilege is to encourage the client to confide openly and fully in his attorney without fear that the communications will be divulged and to enable the attorney to act more effectively on behalf of his client.
We feel that under the peculiar facts of this case, inquiry into certain issues is proper. Because Hymes consulted the lawyer and revealed his knowledge of and interests in roll-on texture, and the law firm in turn advised National on the very same matters, the company derived an unfair benefit in this suit at the expense of Hymes. Consequently, Hymes should be permitted to ask the officers of National and the employees of the law firm questions as to ownership and royalty interests in the patent.
Similarly, the law firm should not have used all the information in its files pertaining to correspondence and meetings with Hymes to prosecute the patent application on behalf of National, should not have used that information in the lawsuit against Hymes, and should not have then denied Hymes access to information in the law firm's files pertaining to communications and meetings between the law firm and officers and employees of National dealing with the same topics. We do not know whether Hymes can prove his case by the use of witnesses of National and of the law firm, but he should be permitted the opportunity to do so.
We thus reverse and remand the case for a new trial on all issues. On remand, the law firm shall not represent National. Hymes shall be permitted to subpoena and question all witnesses, whether employees or officers of National or of the law firm, on the questions of who was to own the patent and who was to derive the benefits thereof. Hymes shall also be allowed to subpoena, from both National and the law firm, any and all records pertaining to the application for the patent existing prior to Hymes' firing by National. Of course, the attorney's trial strategy, mental impressions, and legal theories in preparing for trial shall not be discoverable. Hickman v. Taylor, 329 U.S. 495, 67 S.Ct. 385, 91 L.Ed. 451 (1947). In the retrial, Hymes shall also be permitted to introduce evidence on the question whether consideration was given for the employment agreement he is alleged to have executed to transfer the patent to National.
Reversed and remanded for a new trial.
TODD and SCOTT, JJ., took no part in the consideration or decision of this case.
NOTES
[1]  National Texture Corporation, formerly known as Clemco, Inc., changed its name in March 1974. To avoid possible confusion, it shall be referred to throughout as "National."
