We investigate a model that describes the evolution of a diploid sexual population in a changing environment. Individuals have discrete generations and are subject to selection on the phenotypic value of a quantitative trait, which is controlled by a finite number of bialleic loci. Environmental change is taken to lead to a uniformly changing optimal phenotypic value. The population continually adapts to the changing environment, by allelic substitution, at the loci controlling the trait. We investigate the detailed interrelation between the process of allelic substitution and the adaptation and variation of the population, via infinite population calculations and finite population simulations. We find a simple relation between the substitution rate and the rate of change of the optimal phenotypic value.