OPINION ON STATE’S PETITION FOR DISCRETIONARY REVIEW
MILLER, Judge.Appellant was convicted by a jury of aggravated sexual assault. Punishment was assessed by the court at 20 years imprisonment in the Texas Department of Corrections. The Court of Appeals, 13th Supreme Judicial District, held that the trial court erred in denying appellant’s motion to quash the indictment, which was defective for misjoinder of offenses, reversed appellant’s conviction, and dismissed the indictment. Sifford v. State, 704 S.W.2d 571 (Tex.App.—Corpus Christi 1986). We granted the State’s Petition for Discretionary Review to determine whether the trial court erred in failing to quash the indictment. We will reverse the judgment of the Court of Appeals and affirm appellant’s conviction.
Appellant was charged in a single indictment with aggravated sexual assault and robbery. Appellant filed a pre-trial motion to quash the indictment on the ground that it improperly joined two non-property offenses in violation of Art. 21.24, V.A.C.C.P. The trial court did not rule on appellant’s motion until the State elected to proceed to the jury on the aggravated sexual assault charge and rested. The trial court then denied appellant’s motion to quash.
The Court of Appeals found that denying appellant’s motion to quash was not harmless error. The Court of Appeals found that harm resulted from (1) the reading of the indictment of both crimes before the *441jury, which required appellant to plead not guilty to both offenses; (2) the voir dire; and (3) the State’s opening statement. The State contends that joinder of more than one offense in the same charging instrument is harmless. Under the facts of this case, we agree with the State.
Article 21.24, supra, authorizes the State to join in a single indictment two or more offenses if the offenses arise out of the same criminal episode, as defined in Chapter 3 of the Penal Code. “Criminal episode” means the repeated commission of any one offense defined in Title 7 of the Penal Code, which defines the offenses against property. See V.T.C.A. Penal Code, Sec. 3.01. The State, therefore, violated Art. 21.24, supra, when it joined the offense of robbery, a Title 7 offense, with the offense of aggravated sexual assault, a Title 5 offense, in the indictment in this cause. We find, however, that this misjoin-der was harmless to appellant.
When the State violates the misjoinder rule, the defendant has two options at trial. He may object to the charging instrument on the ground that the State has misjoined offenses. The trial court should then grant the motion to quash, or it may force the State to elect the offense upon which it will proceed. Smith v. State, 64 Tex.Cr.R. 454, 142 S.W. 1173 (1912), and Blackwell v. State, 51 Tex.Cr.R. 24, 100 S.W. 774 (1907). The defendant may, instead, forgo the motion to quash and file a motion requesting the State elect the count in the charging instrument upon which it will proceed. The trial court should grant the motion if the State has misjoined offenses. Crosslin v. State, 90 Tex.Cr.R. 467, 235 S.W. 905 (1921). The State must make this election by the end of the State’s case and before the defense begins to present evidence. Crosslin, supra; Smith, supra; and Blackwell, supra. Once the State has been forced to make an election, any misjoinder error is cured. Campbell v. State, 163 Tex.Cr.R. 545, 294 S.W.2d 125 (1956)
As noted earlier, appellant’s pre-trial motion to quash the indictment was not ruled upon until the State elected at trial to proceed only on the aggravated sexual assault charge. Once the State made this election, the misjoinder error in the indictment was cured. See Campbell, supra. The election by the State eliminated the possibility that appellant would be subject to multiple convictions arising from a single indictment.1
Appellant also was not harmed by the admission at trial of evidence of the alleged robbery since the robbery and aggravated sexual assault were part of one continuous transaction. Evidence of the facts relating to the transaction were admissible to show the context in which the aggravated sexual assault occurred. See Hoffert v. State, 623 S.W.2d 141 (Tex.Cr.App.1981).
We find, therefore, no harm to appellant by the misjoinder in the indictment and by the trial court’s failure to grant appellant’s motion to quash the indictment. The judgment of the Court of Appeals is reversed and appellant’s conviction for aggravated sexual assault is affirmed.
. As of September 1, 1987, the law concerning this issue was changed. The Legislature amended the Penal Code, Sec. 3.01, supra, to read, in part, as follows:
Sec. 3.01. DEFINITION. In this chapter, "criminal episode” means the commission of two or more offenses, regardless of whether the harm is directed toward or inflicted upon more than one person or item of property, under the following circumstances: (1) the offenses are committed pursuant to the same transaction or pursuant to two or more transactions that are connected or constitute a common scheme or plan; or (2) the offenses are the repeated commission of the same or similar offenses.