It can be a hormonal thing too - I used to always get it just before my period, and then sanitary towels exacerbated it.
Being on the pill also makes it worse.
The anti-candida diet is worth considering if you're suffering repeatedly, but it is not for the faint-hearted!
Cut out:
All refined wheat-based products (white bread, white pasta)
All refined carbs (white rice)
All sugar (including fruit)
All yeast-based products (alcohol, bread, Marmite)
All fungus (mushrooms and, I think but I'm not sure, Quorn)
All smoked products (bacon, smoked mackerel)
All fermented products (alcohol, soy sauce, vinegar)
You can eat meat/fish, vegetables/salad, olive oil, and really not much else.
I may have missed things out or there may be other things you can eat - can't remember about dairy, for example.
Definitely worth doing it though, to get the balance of bacteria right in your gut.
Also worth getting some acidophilus (a probiotic supplement). Buy a good quality one from a good healthfood shop -it will be kept in the fridge. Don't take Yakult/Actimel, even the low sugar ones, because they have sugar in them.
Good luck - it's an awful thing to suffer from.