We have studied the dependence of the electron in-plane g factor and spin decoherence time on the built-in electric field (Ei) at the position of a single layer of self-assembled (In,Ga)As∕GaAs quantum dots (QDs). Control of Ei is achieved by inducing screening charges in a p-i-n GaAs matrix with a continuous wave (cw) laser. Using a time-resolved pump-probe technique to measure the spin dynamics via the magneto-optical Kerr effect, we observe a large hole spin decoherence time of 440ps. Measurements as function of the cw laser power and, thus, of Ei show that the electron spin decay time in the QDs depends strongly on Ei and decreases from 310to110ps with increasing Ei. We attribute this effect to increasing tunneling rates of electrons out of the QDs at high Ei. We observe a slight increase of the electron g factor from 0.40±0.03 to 0.46±0.04 with increasing Ei, which might be a result of a changing wavefunction as a result of a different confinement potential due to Ei.