|Where are you putting this code that is supposed to execute?|
If you put it in the form_load() event is should execute. Form2.show should then show the form and execute the code.
Or you could put it into a Public Sub in the form2 module and call it from Form1. You would then need a me.show command at the end of the code.
VB6 works very well on Windows 7, even 64 bit Windows 7,