Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2005
    Location
    Texas
    Posts
    100

    Unanswered: How do I get code to execute when an app is opened in VB?

    I'm a newbie with this....I want some code to be executed whenever my application starts up, how do I do this?

    Thanks.

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by disruptivehair
    I'm a newbie with this....I want some code to be executed whenever my application starts up, how do I do this?

    Thanks.
    Write any Sub procedure and call it in your main().Thats it..
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    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.

    Or

    If you don't want to include a separate sub main, add the code you wish in your main form's Load event.
    Lou
    使大吃一惊
    "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


  4. #4
    Join Date
    Dec 2005
    Location
    Texas
    Posts
    100
    Thanks guys, I'll try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •