delivered the opinion of the court:
Substitution of judge.
Motion must be in writing.
Agnew and three other persons were charged with armed robbery, but Agnew’s case was severed from the others. At his preliminary hearing before Judge Komada, counsel for defendant orally stated an objection to Judge Komada hearing the matter because the judge had prosecuted the defendant on a similar but unrelated charge while State’s Attorney. After some discussion, the motion was denied as untimely. The hearing proceeded, probable cause was found, and Agnew was bound over for trial.
Following a jury trial — over which Judge Komada presided— Agnew was found guilty and sentenced to 8 years’ imprisonment. His appeal raises the sole issue of the propriety of the denial of his motion for substitution.
*81First, we must address the question of whether defendant ever made a motion for substitution of judges under section 114 — 5(a) of the Code of Criminal Procedure of 1963 (Ill. Rev. Stat. 1979, ch. 38, par. 114 — 5(a)). The record leaves some doubt as to whether counsel was making a motion or merely bringing some facts to the court’s attention. The trial judge obviously felt that such motion was made and ruled on it. We are not in a position to second guess and will accept his judgment. The questions we must now address are whether the motion was made too early and whether it was in proper form.
The case most closely on point is People v. Bach (1979), 74 Ill. App. 3d 893, 393 N.E.2d 563. There, the defendant orally moved for substitution of judges at arraignment. The case was thereafter assigned to trial before one of the judges mentioned. The court assumed (without so stating) that the defendant could have obtained substitution at arraignment, but held that the oral motion did not divest the judge of the power to hear the case and the fact that the motion was never reduced to writing or even renewed at any of defendant’s numerous subsequent appearances before the judge constituted waiver.
People v. Samples (1982), 107 Ill. App. 3d 523, also supports the conclusion that a defendant may obtain a section 114 — 5(a) substitution before a case is set for trial, or rather before the defendant knows which judge will preside at his trial. The rationale set forth in Samples is that since a defendant may exercise his right to automatic substitution only once, it does no harm to allow him to exercise it early, especially since section 114 — 5 is to be liberally construed to grant, rather than to deny substitution. (See People v. Howell (1974), 16 Ill. App. 3d 989, 307 N.E.2d 172, aff’d (1975), 60 Ill. 2d 117, 324 N.E.2d 403.) Samples involved the question of whether the fact that .all criminal cases in a particular county are tried before one judge gave a defendant notice of the trial assignment before that judge as soon as his case was set for trial.
Although neither Bach nor Samples are directly on point, we find them persuasive and adopt the position that section 114 — 5(a) motions may be made early, but only once.
Our ruling also eliminates a potentially anomalous situation. The automatic right to substitution of judge afforded defendants by section 114 — 5(a) is terminated when that judge makes a ruling of substance in the case. What exactly is meant by a “ruling of substance” is not clear. There is some indication in People v. Chambers (1956), 9 Ill. 2d 83, 136 N.E.2d 812, that unless the court reviews defendant’s *82case and assesses the credibility of his evidence, a ruling is not one of substance. Since ordinarily only the State presents evidence at a preliminary hearing, the fact that a judge found probable cause would not cut off defendant’s right to automatic substitution as to that judge.
On the other hand, some cases can be read to say that any ruling on the merits (including motions to dismiss, motions to suppress, and pretrial sanity hearings) — whether or not jeopardy attaches — are rulings of substance cutting off the right to automatic substitution. (See People v. Speck (1968), 41 Ill. 2d 177, 242 N.E.2d 208.) Thus, at least in some cases, a probable cause finding at a preliminary hearing could be a ruling of substance.
If we were to hold defendant’s motion to be premature, and if a probable cause finding at a preliminary hearing is a ruling of substance, then a defendant’s section 114 — 5(a) right could be cut off before it ever came to fruition — simply by assigning the case to trial before the judge who sat at the preliminary hearing. We do not hold that a probable cause finding is a ruling of substance — it certainly is not per se. We merely note this possibility and utilize the liberal construction rule of Howell to protect against it.
The “liberal construction rule” also governs our resolution of the second question as to form. Case law is in conflict over whether courts should allow substitution motions even though not in the proper form. Bach refused to do so. People v. Kadlec (1974), 21 Ill. App. 3d 289, 313 N.E.2d 522, although it dealt with section 114 — 5(c), said procedural requirements may be ignored. The “liberal construction rule” would indicate that the latter approach is preferred, but People v. Van Pelt (1974), 18 Ill. App. 3d 1087, 311 N.E.2d 184-also dealing with section 114 — 5(c)—says the liberal construction rule does not authorize ignoring statutory requirements.
We find Bach and Van Pelt persuasive and hold that such motion must be in writing. Dispensing with all the statutory requirements will lead to the ultimate situation where a defendant must be asked at arraignment which judge he does not want to hear his case. Since this is clearly beyond the intendment of the statute, we hold that defendant’s motion was properly denied, even though the trial judge stated the wrong reason for his decision. Cf. People v. York (1963), 29 Ill. 2d 68, 193 N.E.2d 773.
The defendant’s argument that the State has waived any objection to the form of the motion is without force. The trial court *83denied defendant’s motion. Defendant cannot claim that the State waived error when the State received a favorable ruling. On the contrary, under the rationale of Bach, defendant has waived any error because he never renewed his single oral motion.
GREEN, R J., and WEBBER, J., concur.