[RESOLVED] Why/How to solve inherited form error.
Hi,
I have a form Called NewCall, I also have a form addNote which inherits from NewCall.
In the NewCall load event I have
VB Code:
RecommendID = objDatabase.SqlDVFillRecommends(objMainform.grdCallingList.CurrentRowIndex)("PK_RecommendID").ToString()
The Program compiles fine and runs fine its just that this piece of code is causing an error to appear at design time on when opening the inherited form in design view.
Null Reference Exception object reference not set to an instance of an object.
Re: Why/How to solve inherited form error.
Presumably the objects you are using are created when instantiating the base class. It would appear that whatever code is responsible for that is not being executed when instantiating the derived class. You should have a good look at the code for both classes and see why this would be the case.
Re: Why/How to solve inherited form error.
But why do I only get the error when not executing the code, it only appears in design view?
Re: Why/How to solve inherited form error.
I don't know all the details but while the designer does call constructors and things like that, circumstances are different at design time than at run time. You can put MessageBox calls in your code and see them at design time, which might help. Note too that the Component class has a DesignTime property that you can use to male things happen differently at design time and run time. If you're classes are forms then they indirectly inherit Component so they will have this property.