Star Trek: The Next Generation: Season3 | Episode21
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.