 Trimble was elected as a Democratic-Republican to the Fifteenth through the Seventeenth Congress.He was reelected as an Adams-Clay Republican to the Eighteenth Congress and elected as an Adams candidate to the Nineteenth Congress (March 4, 1817 – March 3, 1827).He served as chairman of the Committee on Expenditures in the Department of the Treasury (Sixteenth Congress) and was on the Committee on Elections (Sixteenth Congress).