Sahih Muslim , Book 15, Hadith 4038 (USC-MSA)

'Abdullah (b. Umar) reported that Allah's Messenger found, Umar b. al-Khattab amongst the riders and he was taking oath by his father Allah's Messenger called them (saying) ; Our Allah, the Exated and Majestic, has forbidden you that you take oath by your father. He who bag to take an oath, he must take it by Allah or keep quiet.

وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، - وَاللَّفْظُ لَهُ - أَخْبَرَنَا اللَّيْثُ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ أَدْرَكَ عُمَرَ بْنَ الْخَطَّابِ فِي رَكْبٍ وَعُمَرُ يَحْلِفُ بِأَبِيهِ فَنَادَاهُمْ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ أَلاَ إِنَّ اللَّهَ عَزَّ وَجَلَّ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ فَمَنْ كَانَ حَالِفًا فَلْيَحْلِفْ بِاللَّهِ أَوْ لِيَصْمُتْ ‏" ‏.

sunnah.com