It is possible to determine the gender of a future baby (embryo) before transfer takes place. In fact, this strategy has been used for many years in order to avoid the transmission of sex chromosome hereditary diseases (pre-implantation genetic diagnosis or PGD).
When the technique was in its early days, embryo analysis was carried out on day 3 of embryo development. Nowadays, it is carried out between days 5 and 7 of development (blastocyst stage). The analysis provides a simultaneous understanding of all the chromosomes in the embryo, meaning that transmission of chromosomal abnormalities can be completely eliminated. The technique has a 98% success rate.
Embryo analysis of this kind requires in vitro fertilisation.
Are there other ways of carrying out gender selection? The answer is YES, but the techniques are not terribly reliable.
One of these techniques consists of dividing up the spermatozoa based on their speed. The faster ones theoretically contain a Y chromosome and, therefore, produce a boy, whilst the slower ones contain the X chromosome and produce a girl. The error rate is between 20 and 30% or even greater when the technique is used to try for a girl.
Other gender selection methods are inefficient and are based on the same hypothesis as above. In theory, spermatozoa containing the Y chromosome are faster and live for a shorter period of time. Therefore, having sexual intercourse around the time when a woman is ovulating could help to ensure that the faster sperm and the recently-ovulated oocyte meet up. There is a 50% chance of success.
Spanish legislation currently only permits embryo gender selection when the aim is to avoid the transmission of sex chromosome genetic disorders.