Sunscreen are not designed to prevent sun tanning but they are meant to protect the skin from adverse effects of the sun light.
There is no such thing as a total sunscreen since no sunscreen can offer 100% protection from UV light.
All sunscreen let a fraction of UVB and UVA light reach the skin which produces a sun tan while protecting the skin.
The most important thing is to avoid sunburns which are responsible for skin damage, with subsequent loss of the dead superficial layers a few days later, and premature aging, brown spots and wrinkles.
With the highest protection SPF 50+, the melanin production by the skin will take a few days more.
The sun tan will be more progressive with a better quality and a longer lasting effect.