Got this info from the Freepages at Rootsweb - maybe it will help someone.
Rev. Andrew Thomson.
* In memory of the Rev. Andrew Thomson, for 39 years minister of the General Associate Congregation, Sanquhar, who died 27th September, 1815, aged 72. Also of Margaret Comrie, his wife, who died in December, 1811, aged 62 years. Also of Jessie Thomson, their daughter, who died 1st June, 1851, aged 65. Also of their youngest son, John Thomson, farmer, Townhead, who died 24th August, 1855, aged 65. Also of Mary Thomson, their daughter, who died 28th May, 1862, aged 77. Also of Elizabeth McCall, spouse to the said John Thomson, who died 10th November, 1872, aged 80.
The Rev. Andrew Thomson was the third minister of the Doun-the-Gaite Kirk. He came from Howgate, near Penicuik, and was ordained on 22nd August, 1776. He was a faithful pastor . . . . thirty-nine years in all. . . . .
One of Mr Thomson's sons was the Rev. Dr Thomson of Balfron; and a grandson (son of John Thomson, farmer) was the well-known Rev. Andrew Thomson, D.D., who for upwards of fifty years was the minister of Broughton Place United Presbyterian Church in Edinburgh. Dr Andrew Thomson was born in Sanquhar, and received his early education at the Parish School, and all his long life he kept a warm feeling towards the place of his birth; he died in 1901, aged 86 years, having survived both his wife and their only son by three years, the latter being Shieriff Comrie Thomson, who died within a month of his mother in 1898. . . . .