Form Won't Show
Hey again, I'm having trouble showing a 2nd form. I have a button to press which will switch to a second form but I get 2 errors:
A first chance exception of type 'System.*********enceException' occurred in <application>
A first chance exception of type 'System.InvalidOperationException' occurred in <application>
Please post your code to make the 2nd form appear.
I'm guessing it's sort of like...
[php]
Private Sub Button1_Click(By Val.....blahblahblah)
Form2.show()
Me.Hide()
End Sub
[/php]
Oh duh, yeah I forgot that. Yes, I'm using Form2.Show() Me.Hide()
Yeah Try And Post The Whole Code
We Will Help You Much Better . 0:
nah this happens some times. just add 1 button and sheet and it will work.
Major you're still a beginner to VB.
These problems may see simplistic, but they're actually more in-depth.
You can't just say Get rid of a form and go with it.
Some more code around the exception line will help. But there are three possibilities right now:
1: You've created a form dynamically without the 'New' keyword, which in result is throwing a null reference error. Use the 'New' keyword before creating a new dynamic form.
2: If you've created the form with out dynamic code, then unload the Form from the project. Close the project and then reload it. Now add the Form you previously uploaded, and then call the "FormName.show()" Method. This will hopefully update the project and will recognize it.
3: If you've some code on the load event of the form you are showing then 90 % chance is that, that code is throwing an exception. To solve this, modify the code or wrap it around the Try...Catch block.
Take into account these possibilities and try to solve them. If the error still persists, then we gotta need some code of the project.
Hope this helps !!