In this paper, the cosmological constant and electric charge are incorporated in the Einstein–Maxwell field equations. Two approaches are used to investigate the problem. First, the boundary condition is expressed as a generalized Riccati equation in one of the gravitational potentials. New classes of exact solutions are found by writing the Riccati equation in linear, Bernoulli, and inhomogeneous forms. Our solutions contain previous results in the absence of the cosmological constant and charge. Second, it is possible to preserve the form of the generalized Riccati equation by introducing a transformation called the horizon function. This transformation simplifies the generalized Riccati equation. We generate new solutions to the transformed Riccati equation when one of the metric functions serves as a generating function. We also obtain other families of new classes of exact solutions, where the horizon function serves as a generating function. Interestingly, new uncharged solutions, not contained in previous studies, arise as special cases of the inhomogeneous Riccati equation in both approaches.