Pretty sure this is Stowaway to the Moon (1975).
Stowaway to the Moon is a 1975 television film directed by Andrew V. McLaglen and starring Lloyd Bridges among others. The plot centers around a preteen boy who stows away on an Apollo mission to the Moon. The film also features Pete Conrad, the third person to walk on the Moon. The film was based on the novel of the same name, written by William Roy Shelton.
Eli ("E.J.") Mackernutt Jr. is an 11-year-old boy in Titusville, Florida who wants to travel in space. His best friend Joey helps him to sneak into the nearby Kennedy Space Center. Wearing a hardhat and fake security badge and carrying a toolbox, E.J. slips by the other workers unnoticed.
He hides inside a trash compartment in the command module Camelot of the Saturn V rocket before the astronauts arrive for the scheduled Apollo flight to the Moon. As they work through the preflight checklist, Mission Control informs them that the spacecraft is overweight by 87 pounds. They cannot explain the discrepancy, but decide that it is not important enough to delay the launch, and the countdown continues. Meanwhile, E.J.'s father Eli Sr. discovers a note from his son telling him of his intentions. Eli and his wife Mary rush to the Kennedy Space Center and insist to the gate staff that their son is on the rocket, but no one believes them.
After the rocket launches on schedule, command module pilot Ben Pelham discovers E.J. Through flashbacks, E.J. tells his story to the astronauts. He and Joey were building a large scale model of a space capsule, and to raise money to build it, they performed work for the elderly Jacob Avril, who owns property adjoining the Kennedy Space Center. Avril's close proximity to the Space Center gives E.J. the idea of stowing away on the upcoming Moon launch.
The astronauts then contact Charlie Englehardt, the flight director. Englehardt tells the crew that the mission is scrubbed, but when the world learns about the stowaway, the principal investigator urges that the mission continue because it is the only planned visit to the Rupes Altai. E.J. apologizes for his stunt on live television and asks that his actions not jeopardize the crew's important mission. Englehardt recognizes that E.J. has persuaded the public and US president to continue the mission, and reluctantly gives his consent for the planned Moon landing.
E.J. helps clean the cabin with a vacuum cleaner and performs other chores. Once in lunar orbit, mission commander Rick Lawrence and lunar module pilot Dave Anderson prepare to undock from the command module and descend to the surface. E.J. notices that Pelham is ill, but the astronaut insists that it is just space adaptation syndrome and asks E.J. to say nothing to the others.
Lawrence and Anderson depart in the Lunar Module Little Dipper, but Pelham's condition deteriorates rapidly. With the ground crew's help, E.J. saves Pelham's life with the vacuum cleaner when he throws up inside his helmet. The boy cares for the ailing astronaut and helps locate the lunar module, which has landed far off course. Despite intermittent telemetry, the lunar module is able to return to the command module with a Genesis Rock; without E.J., Pelham would have died and a rendezvous would have been impossible, killing the other astronauts.
On the way back to Earth, a stuck valve bleeds much of the oxygen from the ship. The astronauts remain in their spacesuits, while E.J. must retreat to Little Dipper until re-entry. Despite the low oxygen and freezing temperatures, E.J. never loses faith in the dream of space travel and keeps himself awake by vividly describing the Earth from space to Englehardt and the astronauts.
Some time later back on Earth, E.J., Joey, and Avril watch the full moon from Avril's property. E.J. remembers Lawrence's words: "Kid, you got us off the Moon. Without you we'd be part of those rocks and rilles down there forever and ever! Now we're going home, and we've got you to thank for that!"
The vomiting scene occurs at the 1:01:36 mark in the YouTube video below, if anyone cares to see it.