Bring a large pot of lightly salted water to a boil. Add pasta, and cook until al dente, 8 to 10 minutes. Drain pasta, but do not rinse. Let stand 5 minutes. To make the dressing, combine the mayonnaise, vinegar, sugar, mustard, salt, and pepper in a bowl. Set aside. Combine the onion, celery, bell pepper, carrots, and ham in a large bowl. Stir in the dressing. Add the pasta and toss gently to blend all ingredients. Chill at least 4 hours before serving.