Thanks and clarification

The second one worked great. Thank you.
I don't quite understand the first on though.
Is the code exactly like it should be entered? and where do I put it Under the frame or one button or both? Are the names of my button the instance name or the var name?
Thanks for your help,
Neal