
104 Ill. App.3d 1046 (1982)
433 N.E.2d 1024
MARTIN J. OBERMAN et al., Plaintiffs-Appellants,
v.
JANE M. BYRNE, Mayor of the City of Chicago, et al., Defendants-Appellees.
No. 81-1579.
Illinois Appellate Court  First District (3rd Division).
Opinion filed March 10, 1982.
Martin J Oberman, Lawrence S. Bloom, and Jerome B. Meites, all of Chicago, for appellants.
Stanley Garber, Corporation Counsel, of Chicago (Robert R. Retke and Jerome A. Siegan, Assistant Corporation Counsel, of counsel), for appellees.
Reversed and remanded.
JUSTICE McGILLICUDDY delivered the opinion of the court:
The plaintiffs, Martin J. Oberman, Lawrence S. Bloom, William O. Lipinski, Danny K. Davis and David D. Orr, brought this action individually and on behalf of all Chicago taxpayers, in order to enjoin the expenditure of certain public funds by the defendants. The defendants are the city of Chicago, its mayor Jane M. Byrne, its comptroller Daniel Grim, and its commissioner of the department of neighborhoods Harry Sikorski. On June 24, 1981, the trial court dismissed plaintiffs' first amended complaint, and the plaintiffs appeal.
In December 1980 the city council of the city of Chicago appropriated $375,000 to the department of neighborhoods in order to conduct a canvass of all Chicago neighborhoods concerning public opinion on city services. The plaintiffs alleged that this appropriation was being used to conduct a survey of "a partisan political nature." The plaintiffs asserted that the expenditure of public funds on such a survey was without a public purpose in violation of the Illinois Constitution and State law. The Constitution of the State of Illinois (Ill. Const. 1970, art. VIII, § 1(a)) states that "Public funds, property or credit shall be used only for public purposes."
*1047 The Illinois Municipal Code provides that the corporate authorities in municipalities with a population of 500,000 or more may "appropriate such sums of money as are deemed necessary to defray all necessary expenses and liabilities of the municipality * * *." Ill. Rev. Stat. 1979, ch. 24, par. 8-2-1.
Plaintiffs' original complaint was filed on Friday April 10, 1981, at approximately 4:20 p.m. and assigned to Judge Reginald Holzer. Since Judge Holzer was on vacation, Judge Richard Curry heard his motions during his absence.
On April 13, 1981, the parties appeared before Judge Curry in connection with plaintiffs' motion for a temporary restraining order. Judge Curry entered an agreed order enjoining the defendants from expending any funds on the survey until further order of court. On April 14, 1981, by agreement of the parties Judge Curry modified this order. He also allowed the plaintiffs to file their first amended complaint.
Judge Holzer returned to his courtroom on Monday, April 20, 1981, and the parties first appeared before him on April 21, 1981. Defendants' request for leave to file a motion to strike and dismiss the complaint was allowed. The court set a briefing schedule on this motion. On the same day, the plaintiffs presented a petition requesting a change of venue due to their fears that they would not receive a fair trial before Judge Holzer. The court advised the plaintiffs that their petition was not in proper form and allowed the plaintiffs to withdraw the petition in order to amend it.
The following day the plaintiffs presented a petition for change of venue in which Martin Oberman alleged that Judge Holzer was prejudiced against him. The court denied this petition "by reason of undue delay."
On June 24, 1981, Judge Holzer dismissed plaintiffs' first amended complaint for failure to state a cause of action.
The plaintiffs first contend that the trial court improperly denied their petition for a change of venue. A change of venue in any civil case may be had "[w]here any party * * * fears that he will not receive a fair trial in the court in which the action is pending, because * * * the judge is prejudiced against him * * *." (Ill. Rev. Stat. 1979, ch. 110, par. 501(2).) The petition must be presented before the trial or hearing begins and before the judge to whom it is presented has ruled on any substantial issue in the case. (Ill. Rev. Stat. 1979, ch. 110, par. 503; Sansonetti v. Archer Laundry, Inc. (1976), 44 Ill. App.3d 789, 358 N.E.2d 1142.) This requirement is designed to preclude counsel from first ascertaining the attitude of the trial judge on a hearing relating to some of the issues of the case and then, if the court's judgment should not be in harmony with counsel's theory, asserting the prejudice of the court as grounds for a change of venue. In re Estate of Roselli (1979), 70 Ill. App.3d 116, 388 N.E.2d 87.
*1048 When the petition is in proper form and in compliance with the statute, the right to a change of venue is absolute and the judge has no discretion in denying the petition. (County of Du Page v. E & E Hauling, Inc. (1977), 67 Ill.2d 390, 368 N.E.2d 110.) Furthermore, the provisions of the venue statute are to be liberally construed in order to effect rather than defeat a change of venue, particularly when prejudice of a judge is charged. Pavlis v. Jewel Tea Co. (1977), 53 Ill. App.3d 287, 368 N.E.2d 719.
 1 There is no dispute concerning the form of plaintiffs' petition; rather, the defendants argue that the petition was not timely filed. The defendants contend that the plaintiffs should have presented their petition to Judge Curry on April 13 or to the presiding judge of the chancery division in Judge Holzer's absence. We do not believe that such action was necessary. The statute and case law provide that the petition must be presented before the judge to whom it is presented has ruled on any substantive issue. The plaintiffs appeared before Judge Holzer on the second day that he was available to hear their petition. When the court indicated that the petition was not in proper form, the plaintiffs withdrew it and returned to court the following day with an amended petition. At this time Judge Holzer had neither heard nor ruled on any issue of substance in the case. We therefore find no basis for Judge Holzer's conclusion that the petition was not timely filed.
 2 The plaintiffs also argue that the trial court erred in barring certain discovery and in dismissing their complaint. Because any order entered subsequent to an improper denial of a change of venue is void (Pavlis v. Jewel Tea Co.), we need not consider these issues.
For the foregoing reasons the judgment of the circuit court of Cook County is hereby reversed, and this matter is remanded for further proceedings consistent with the views expressed herein.
Reversed and remanded.
WHITE, P.J., and McNAMARA, J., concur.
