CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2013
    Posts
    1

    Thumbs down Object reference not set to an instance of an object

    I get that error shortly after start-up of my application. I'm running in debug mode and error appears with a Popup. not at line in the source ,.,. so I not sure where fault is occurring. How do I trap this bug or find its location.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Object reference not set to an instance of an object

    get ride of ON ERROR RESUME NEXT.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Object reference not set to an instance of an object

    No, no, no, no, absolutely no! Do not use On Error Goto! This is VB.NET, I'd suggest you make use of Try and Catch blocks, as explained in this FAQ :

    http://forums.codeguru.com/showthrea...are-exceptions

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured