Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

open a from

Posted on 2006-05-24
6
Medium Priority
?
156 Views
Last Modified: 2010-04-23
I have two forms in my project, Form1 and Form2. I'm trying to open Form2 from Form1:

In the Form1_Load event I have:

Dim f As Form2=New Form2
 f.Show() <- get an error here - "Object reference not set to an instance of an object."

What am I doing wrong?
0
Comment
Question by:YZlat
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:mydasx
ID: 16755893
put a break point in the formload of page 2 and check your variables there.
0
 
LVL 7

Expert Comment

by:davidrichardson
ID: 16755948
Dim f As New Form2
f.Show()
0
 
LVL 35

Author Comment

by:YZlat
ID: 16755999
davidrichardson  I've tried that already

mydasx, in line Dim f As Form2=New Form2, f is fine, but it still gives me an error in line
f.Show
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
mydasx earned 500 total points
ID: 16756039
right...  my post was to put a break point in form2's page load call.  it is going to call pageload before it displays which means if you have an exception being thrown in page load of page 2 you will not see the page but the error will fire.  put a break point right at the top of page load in page2 and walk throught it.
0
 
LVL 35

Author Comment

by:YZlat
ID: 16756116
it does not even get to Form2_Load
0
 
LVL 5

Expert Comment

by:mydasx
ID: 16756413
did you hit f11 on the call?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month21 days, 7 hours left to enroll

810 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