Cryptic or post-copulatory, female choice could markedly affect the ou
tcome of sperm competition, i.e. a female could differentially manipul
ate ejaculates within her own body, affecting the fertilization succes
ses of her mating partners. Female yellow dung flies, Scathophaga (Sca
tophaga) stercoraria, have three spermathecae, the sperm-storage organ
s, and can to some extent store the sperm of different males in differ
ent places. I show that a female's body size, as well as those of her
mates, influences the process of sperm storage. Furthermore, females l
ay eggs of different genotypes under different environmental condition
s. Females use both cues correlated with single locus variation (at th
e locus for the enzyme phosphoglucomutase, PGM) and quantitative trait
variation (in body size and development time) when using sperm to fer
tilize their eggs. It is proposed that this allows a female to match t
he genotypes of her offspring to the conditions in which the larvae mu
st grow, thus increasing their subsequent fitness. I describe an exper
iment where larvae of different PGM genotypes were raised in different
environments and the most successful genotype was different in differ
ent environments. The complexity of the female reproductive system may
therefore have evolved because the best father for a female's offspri
ng, from the female's viewpoint, is different under different environm
ental conditions. The effect interacts with the established male-deter
mined effects to influence the outcome of sperm competition.