Are you sure you are using vb6?

The code looks like it is for vb.net (from the click event)