add a sub main() in a code module. Put your startup code in this sub.
Reference sub main() as the startup object in your Project-Properties menu.
Make sure your sub main loads/shows the main form.
If you don't want to include a separate sub main, add the code you wish in your main form's Load event.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert