Results 1 to 5 of 5

Thread: [02/03] Object reference not set to an instance of an object Error

Hybrid View

  1. #1
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [02/03] Object reference not set to an instance of an object Error

    Quote Originally Posted by jeffnyc
    Code:
    frm1.lstRight.Items.CopyTo(sourceArray, 0)
    Is frm1 the actual name of the form, or the current instance? If frm1 is the name of the form then that is your problem. Also, is this the line that throws the error?
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Re: [02/03] Object reference not set to an instance of an object Error

    Quote Originally Posted by circuits2
    Is frm1 the actual name of the form, or the current instance? If frm1 is the name of the form then that is your problem. Also, is this the line that throws the error?

    frm1 is the instance, i believe... fm1 is declared in a module and when form1 loads frm1 = me

    i believe it is the way i am copying listview collection of objects to a standard array and in the way i declare it -

    haven't tried stimbo's suggestion but also wondering if i need the NEW keyword anywhere

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