Solved

System.InvalidOperationException was unhandled

Posted on 2007-04-05
2
707 Views
Last Modified: 2008-02-01
Hi Experts,

I have a piece of code that load up a form: -

frmCreatePurchaseOrder.show()

when I run it I get the following error message: -

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Object reference not set to an instance of an object."

What does this mean please and how can I find out whats causing it.

Many Thanks
Lee
0
Comment
Question by:ljhodgett
2 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 18857757
use try...catch blocks:


try

  your code here

catch ex as exception
  MsgBox(ex.Message & " - " & ex.StackTrace)
end try
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 18857788
Ummm... more to the point... frmCreatePurchaseOrder is probably set to nothing.

Try:
Dim frm as new frmCreatePurchaseOrder
frm.Show()
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with error message for ReportViewer in VS2015 4 42
DataGridview Currency Formating? 22 53
Visual Studio 2013 Shortcut (VB) 4 34
Close tabpage of custom control 9 23
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now