new to birth control

if i get on the depo on one of my last days of my period, does it work immediately?