The presence of multivalent counterions induces an upper critical solution temperature (UCST) in addition to the known lower critical solution temperature (LCST) of poly(N,N-dimethylaminoethyl methacrylate) (PDMAEMA). The LCST-type cloud points can be adjusted by pH of the buffer, whereas the UCST-type cloud points can be adjusted by the concentration of trivalent counterions. High pH favors the LCST transition, whereas lower pH extends the UCST-type miscibility gap at constant concentration of trivalent counterions. By use of hexacyanocobaltate(III) as a trivalent counterion, we can even switch off again the UCST-behavior by UV-illumination (photoinduced dissolution).