|
-
Nov 2nd, 2005, 11:28 AM
#1
Thread Starter
Frenzied Member
[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.
-
Nov 2nd, 2005, 07:17 PM
#2
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.
-
Nov 3rd, 2005, 09:17 AM
#3
Thread Starter
Frenzied Member
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?
-
Nov 3rd, 2005, 06:10 PM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|