It would appear, from the canon we have, that to create a Horcrux, one does not need to use a murder that just took place.
Riddle killed his father and grandparents during a summer away from Hogwarts, then, once back at Hogwarts had the conversation about Horcruxes with Slughorn, and then created the Ring Horcrux.