1. An image forming apparatus having at least one of a copying and printer functions, and a facsimile function, comprising: means for inputting image data and size information of an image forming medium on which an image based on the image data is to be formed; means for accommodating image forming media having different sizes, respectively; means for forming an image, based on the image data input from said input means, on each of the image forming media accommodated in said accommodation means; means for detecting sizes of image forming media stored in said accommodation means; and means for switching, on the basis of a detection result of said detection means, between an image forming operation of said image forming means in the facsimile function and an image forming operation of said image forming means in the copying or printer function; wherein said switching means comprises: control means for, when the detection result of said detection means indicates that an image forming medium of a target size is not accommodated in said accommodation means, interrupting the image forming operation of said image forming means in the copying or printer function and continuing the image forming operation of said image forming means in the facsimile function by using an image forming medium having a size different from the target size, wherein said control means comprises: first control means for continuing the image forming operation of said image forming means in the facsimile function by using a first image forming medium as a medium on which an image is to be formed when the detection result of said detection means indicates that the image forming medium having the target size is not accommodated in said accommodation means, and the first image forming medium larger than that of the target size is accommodated in said accommodation means; and second control means for continuing the image forming operation of said image forming means in the facsimile function by using a second image forming medium as a medium on which an image is to be formed when the detection result of said detection means indicates that the image forming medium having the target size and the first image forming medium are not accommodated in said accommodation means, and the second image forming medium smaller than that of the target size is accommodated in said accommodation means.