Question Object reference no set to an instance or object ?

manny cash

Member
Joined
Oct 19, 2024
Messages
21
Programming Experience
Beginner
Hi People, blessings

I had create a teble, Primary, key 2 datetimepicker and the rest NVarchar. Now I have 2 button clicks, Add and Save, the fields and the textbox are the same. When I ran it, I got this error. I was looking with another programmer, and he and I couldn't fix it. In this case I need your help because you are experienced in programming. Here is a picture of my code. Thank you in advance, guys.

1745350663990.png


1745350722275.png
 
I specifically asked you in your last thread to not post pictures of code. Post the code as text, formatted as code. You can highlight one or more lines as well that way. You should then provide any error messages as appropriately formatted text as well. If we want to search the web for that error message, we shouldn't have to type it all out ourselves when you already have it. The same goes for code if we want to run it or provide an edited version. You can provide a screenshot in addition to the text, if it adds genuine value, but ALWAYS provide the text.
 
As for the issue, what the error message is telling you and you could have seen for yourself by simply mousing over the variable, is that txtEmail is Nothing. You can't get the Text of an object that doesn't exist. Either you have never actually created a control with that name and have simply declared a property manually, or you have explicitly assigned Nothing to txtEmail at some point. My guess would be that you intended to clear the Text at some point but you assigned Nothing to txtEmail instead of txtEmail.Text. That's an educated guess but you can just search for all usages of txtEmail to find out for yourself.
 
I specifically asked you in your last thread to not post pictures of code. Post the code as text, formatted as code. You can highlight one or more lines as well that way. You should then provide any error messages as appropriately formatted text as well. If we want to search the web for that error message, we shouldn't have to type it all out ourselves when you already have it. The same goes for code if we want to run it or provide an edited version. You can provide a screenshot in addition to the text, if it adds genuine value, but ALWAYS provide the text.

OK, I understand now
 
Back
Top