?
Solved

System.InvalidOperationException was unhandled

Posted on 2007-04-05
2
Medium Priority
?
720 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

801 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