I managed to get rid of that error. Not too sure what sorted it in the
end but what I did was rename the form, then I commented out all the
code behind it and ran it. I uncommented out code a bit at a time to
see if it would run and just rearranged the order of my code and that
seemed to work.

All is fine now.

Thanks.

On Feb 18, 1:18 pm, nikhil gaitonde <[email protected]> wrote:
> Hi,
>
> Please try to follow the following steps and debug:
> 1. Keep a break point on the button click event which opens the form.
> 2. Once it reaches there debug it line by line and find the exact source of
> problem.
> 3. It should be caused because some component is not initialised or set to
> null in between.
> 4. When its in debug mode press Ctrl + Alt + E and select the 2nd and third
> option. It will usually detect the null reference exceptions.
>
> If none of these work then try to share the code. I will probably have a
> look.
>
> Regards,
> Nikhil
>
>
>
> On Wed, Feb 18, 2009 at 6:35 PM, Cerebrus <[email protected]> wrote:
>
> > 1. Does the form use any custom or usercontrols that possibly have
> > compilation errors ?
> > 2. If the form has DataGridViews, has the binding source or data
> > source changed ?
>
> > If you're trying to open the form in design mode, you will often
> > encounter such an error if there is a fatal error while trying to
> > render one of the form components. Trying removing the components one
> > by one from the Designer.(vb/cs) file and then open the code file and
> > check for errors.
>
> > On Feb 18, 4:40 pm, Laura <[email protected]> wrote:
> > > Hi, I keep getting the following error when I run my project and click
> > > on the button that opens  frmAbsentees;
>
> > > "An error occurred creating the form. See Exception.InnerException for
> > > details.  The error is: Object reference not set to an instance of an
> > > object."
>
> > > I don't get this error opening any other form. I've deleted the form
> > > several times and recreated it but this error keeps showing up.
>
> > > I've created other forms since and they work fine.
>
> > > I don't understand this error.  As soon as I put some bit of code
> > > behind the form the error comes up.
>
> > > I was getting this error last weekend aswell on another form but once
> > > I deleted it and made from scratch again, it was fine.
>
> > > This error only really came about since I started dealing with
> > > datagridviews, if that has anything to do with it??
>
> > > I can show you code if you want but I think its something more than
> > > that.
>
> > > Does anyone know what's going on?
> > > Any suggestions??- Hide quoted text -
>
> - Show quoted text -

Reply via email to