>Methods and events cannot contain nested procedures or class definitions. it gave me that error when i place the code in a command button.
Create this as a separate program or a method and call it from the button.
If it's not broken, fix it until it is.
My Blog