There are too many variables to answer that question definitively, but piecemeal can often be more costly. It depends on a number of factors, including the purchase price of the vacuum, and don't forget the cost of shipping and sales tax, the number of parts you need, and how many of them you might already have on hand.
Case in point: A couple of years ago, I picked up a Sanitaire S645 blue series upright for $12 that looked more bedraggled than it really was, and I quickly realized I had all the parts I needed to put it to rights, except for a cord and a headlight bulb. All told, I had it fixed up for about $40, including the cost of the vacuum cleaner.
On the other end of the spectrum was a Filter Queen Majestic canister that I paid $5 for and spend more than $50 on, trying to put it to rights before I gave up and donated it to my church. That's just the way it goes sometimes.