This is the one you were thinking off, the lat episode of TNG:
http://memory-alpha.org/wiki/All_Good_Things
Thank you for the info.