This movie is definitely over 12-13 years old, probably mid 90s.
A high school/college is sending some students to a space trip. A boy, who has a crush on a girl, follows her to an exhibition. Over there, he picks up a pass of another boy who was named to go to this space trip as the girl also had a similar pass. At that time, he was unaware that the pass holders were going to space.
Little the protagonist knew, the pass he stole of the other boy, was the captain of that spaceship. Now when they got in the space, some issue (major engine failure or hit by a small meteoroid or some other twist which always happens in movies) happened and this guy had to prove himself, and impress the girl too.