That was just a booty call when she was drunk or something like that.I remember it being tasha yar
The episode I'm talking about occurred a few years later.
In Theory (Star Trek: The Next Generation) - Wikipedia
Data, an android, and Jenna D'Sora are in the torpedo room configuring several probes with which the Enterprise will explore a nearby nebula. D'Sora explains that she just split up with her boyfriend and Data attempts to comfort her. Later they play together in a chamber concert along with Keiko O'Brien (Rosalind Chao). D'Sora complains of her abilities as a musician, but Data insists that he could not hear anything wrong.
Later on the bridge, Data is reviewing the information from the probes sent into the nebula. He theorises that life might have evolved differently in the nebula because of the volume of dark matter detected. Captain Jean-Luc Picard (Patrick Stewart) orders the ship to the nearest planet within the nebula. Data and D'Sora configure further probes, when she kisses him on the cheek and then on the lips, before leaving the room. Data seeks the opinion of his friends, including Picard, Guinan (Whoopi Goldberg), Geordi La Forge (LeVar Burton), Commander William Riker (Jonathan Frakes), Deanna Troi (Marina Sirtis) and Worf (Michael Dorn). Data decides to pursue the relationship and goes to D'Sora's cabin with a bunch of flowers, where he informs her that he created a romantic subroutine for the relationship.
Meanwhile, the Enterprise is approaching the planet. Picard enters his ready room and finds his belongings scattered on the floor. He calls in Worf, who cannot explain their displacement. D'Sora arrives at Data's cabin where he is painting. She tells him to continue, but is then annoyed when he does so, causing him some confusion. The ship arrives at the coordinates for the planet but finds nothing there. Then it suddenly appears as the ship's computer warns of a depressurization in the observation lounge. The crew investigate and find all the furniture piled in one corner of the room.
Data is visiting D'Sora, but she seems unhappy and he is acting erratically in order to find an appropriate response to make her happy. It becomes evident to the crew that the nebula is causing distortions in space; Picard orders the ship into warp to leave the nebula as quickly as possible but this speeds up the distortions. Whilst investigating them, Lieutenant Van Mayter (Georgina Shore) is killed when a distortion embeds her into the deck. Data discovers that dark matter is causing the distortions. The ship can detect the pockets at short range, but not in enough time to move out of the way. Worf proposes using a shuttle to lead the Enterprise out, and Picard insists on piloting it alone.
Picard pilots the shuttle through the field of distortion pockets. Chief Miles O'Brien (Colm Meaney) transports the Captain back to the ship before the shuttle is destroyed. The approach resulted in the Enterprise nearing the edge of the nebula, and they quickly depart. Afterwards, D'Sora reveals to Data over a romantic dinner in his quarters that she broke up with her boyfriend because he was emotionally unavailable and then pursued him because he was the same. Data realises that she is breaking up with him and explains that he will delete the subroutine. D'Sora departs and Data is seemingly unperturbed, although his cat, Spot, jumps into his lap as if to comfort him.