I have a custom control that is acting like an MS Access subform. When I modify a new record, it is supposed to add a new blank record to the subform, just like MS Access does (in the subform the record has a * indicating it is a new and blank record).
In my project, if I modify a text box and tab out to or click on another field in the same record, a new blank record is added successfully to my subform (which is exactly how I want it to work). However, if I modify the text box and click or tab anywhere outside the newly modifed subform record I get an error:
Object reference not set to an instance of an object.
For the life of me I can't track down this error. If I set breakpoints at all the relevant spots I can step through every single line until the call stack only has "Non-user Code" and the main entry point, and then it throws the error.
I do know that if I REM out one line (a procedure call) the error does not occur. However, if I UNREM the line and step through each line it runs fine until the "Non-user Code" at which point the error occurs and the debugger shows me the ending curly brace for my Main() entry point.
I need a better way to figure out exactly where this error is being thrown. I'm trying to figure out if the locals window can be of any help, but I guess I don't know exactly where to look. The stacktrace has a bunch of stuff in it, but it seems like its all internal to .NET so I really can't see what's going wrong.
Any suggestions?
In my project, if I modify a text box and tab out to or click on another field in the same record, a new blank record is added successfully to my subform (which is exactly how I want it to work). However, if I modify the text box and click or tab anywhere outside the newly modifed subform record I get an error:
Object reference not set to an instance of an object.
For the life of me I can't track down this error. If I set breakpoints at all the relevant spots I can step through every single line until the call stack only has "Non-user Code" and the main entry point, and then it throws the error.
I do know that if I REM out one line (a procedure call) the error does not occur. However, if I UNREM the line and step through each line it runs fine until the "Non-user Code" at which point the error occurs and the debugger shows me the ending curly brace for my Main() entry point.
I need a better way to figure out exactly where this error is being thrown. I'm trying to figure out if the locals window can be of any help, but I guess I don't know exactly where to look. The stacktrace has a bunch of stuff in it, but it seems like its all internal to .NET so I really can't see what's going wrong.
Any suggestions?