Let's do a back-of-the-envelope calculation:
Let $M\approx 2.0\cdot 10^{30}\text{kg}$ be the mass of the sun and $m\approx 6.0\cdot 10^{24}\text{kg}$ the mass of the earth, $R\approx 1.5\cdot 10^{11}\text{m}$ the distance between earth and sun and $r\approx 3.8\cdot 10^8\text{m}$ the distance between earth and moon.
The relative accelarationacceleration of the moon respective to earth due to the difference in gravity of the sun can be approximated by $$ \Delta a = \frac{GM}{R^2} - \frac{GM}{(R+r)^2} = \frac {GM}{R^2}\left( 1 - \frac 1{(1+\frac rR)^2} \right)\approx \frac{2GMr}{R^3} $$ via Taylor expansion.
The moon's accelarationacceleration due to earth's gravity is $$ a = \frac {Gm}{r^2} $$ and we end up with $$ \frac a{\Delta a} \approx \frac{mR^3}{2Mr^3}\approx 92 $$ Personally, I'd have expected some more powers of ten here, but of course this should still be more than enough to keep the moon from wandering off...