@pbaldy: Thanks a lot!! It works as I want it to. You just solved a huge problem for me :) And you are absolutely right. PartID is 1, 2, 3...upto the number of parts that the user has entered. If he has entered 5 parts, PartID would be from 1 to 5. Actually, the user enters directly into the...