On May 8, 1822, the last day of the First Session of the 17th Congress, William Milnor (F) of Pennsylvania's 1st district resigned. A special election was held to fill the resulting vacancy on October 1, 1822, a week before the general elections for the 18th Congress.
Election results
Forrest took his seat December 2, 1822
References
Pennsylvania's 1st congressional district special election, 1822 Wikipedia(Text) CC BY-SA