Accretion of matter onto astronomical objects is an important phenomenon of long-standing interest to astrophysicists and the most likely scenario to explain the high energy output from quasars and active galactic nuclei. Some analytic solutions for simple cases have been obtained in literatures. Here we obtain an analytic solution for accretion of a gaseous medium onto a Kerr-Newman black hole which moves at a constant velocity through the medium. The gaseous medium has an adiabatic equation of state: P=ρ, which implies that the adiabatic index is equal to 2 and that the speed of sound is equal to the speed of light, so the flow velocity must be subsonic everywhere and therefore no shock waves arise. We consider the flow in the Kerr-Newman black hole rest frame. The flow is into, and not out from, a Kerr-Newman black hole. We seek a stationary solution, assuming a homogeneous fluid moving at constant velocity at large distances. The flow of matter is approximated as a perfect fluid with zero vorticity, which means the velocity of the perfect fluid can be expressed as the gradient of a potential: huμ=ψ,μ. Assuming that no particles are created or destroyed, then the particle density n is conserved, which results in the equation of continuity for the particle density: (nuα);α=0 and it reduces to (ψ,α);α=0 for the case of an adiabatic equation of state. By assuming the asymptotic boundary condition in spherical coordinates and the general formula of the solution in the Kerr-Newman spacetime, we obtain the concrete form of the equation for the potential (ψ,α);α=0 and derive the solution under two boundary conditions: the expression of the potential ψ at infinity and the particle density n are finite everywhere, including at the event horizon of a black hole. We present the mass accretion rate which depends on Lorentz factor, the mass, the electric charge, and the angular momentum, but it is independent of the orientation of the black hole’s spin with respect to the incident direction of the flow. The flow is fully three dimensional for Kerr-Newman black hole, which is a function of spherical coordinates (r, θ, ϕ) and has no spherical symmetry and axial symmetry. The results obtained here may provide valuable physical insight into the more complicated cases and can be generalized to other types of black hole.