Star Trek: The Next Generation 3×21 : Hollow Pursuits
Stardate: 43807.4
A nervous and insecure officer, Lt. Reginald Barclay, places the Enterprise in great danger when he neglects his duties in Engineering, and instead spends his time acting out his fantasies on the holodeck.