Why do you have 40 commandbuttons performing the same function ?
Only ask as it maybe easier if you just designed the need for 40 out rather then look for an easier method of call the same procedure?