Welcome to Dream.In.Code
Become a VB Expert!

Join 137,230 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,852 people online right now. Registration is fast and FREE... Join Now!




Must have Starup Form

 
Reply to this topicStart new topic

Must have Starup Form

Schwarzenegger
20 Feb, 2007 - 12:59 AM
Post #1

New D.I.C Head
*

Joined: 20 Feb, 2007
Posts: 13


My Contributions
I lost a biggish VB program I was developing through a Save mishap. Luckily I had an MSWord copy of the program code but had to recreate the form from scratch. Now that I have got it all back together again the program comes up with " Must have Startup Form or Sub Main()" Somehow the code and the form do not connect. How do I fix this problem?

Cheers
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Must Have Starup Form
20 Feb, 2007 - 02:23 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,230



Thanked: 40 times
Dream Kudos: 25
My Contributions
Do you have more than one form? If so, you generally have to set the entry point of the program to be the main form, or the Sub Load() procedure. The property can be changed if required.

http://msdn2.microsoft.com/en-us/library/1...w0c(VS.80).aspx

User is online!Profile CardPM
+Quote Post

Schwarzenegger
RE: Must Have Starup Form
20 Feb, 2007 - 02:56 AM
Post #3

New D.I.C Head
*

Joined: 20 Feb, 2007
Posts: 13


My Contributions
QUOTE(Schwarzenegger @ 20 Feb, 2007 - 01:59 AM) *

I lost a biggish VB program I was developing through a Save mishap. Luckily I had an MSWord copy of the program code but had to recreate the form from scratch. Now that I have got it all back together again the program comes up with " Must have Startup Form or Sub Main()" Somehow the code and the form do not connect. How do I fix this problem?

Cheers



QUOTE(Schwarzenegger @ 20 Feb, 2007 - 01:59 AM) *

I lost a biggish VB program I was developing through a Save mishap. Luckily I had an MSWord copy of the program code but had to recreate the form from scratch. Now that I have got it all back together again the program comes up with " Must have Startup Form or Sub Main()" Somehow the code and the form do not connect. How do I fix this problem?

Cheers



QUOTE(Amadeus @ 20 Feb, 2007 - 03:23 AM) *

Do you have more than one form? If so, you generally have to set the entry point of the program to be the main form, or the Sub Load() procedure. The property can be changed if required.

http://msdn2.microsoft.com/en-us/library/1...w0c(VS.80).aspx

I have only one form. I have never had this kind of problem before with my other programs. I have looked at your reference but it is way over my head as is most VB help. I am afraid I need to be told in simple English what to do.
User is offlineProfile CardPM
+Quote Post

jstephens
RE: Must Have Starup Form
20 Feb, 2007 - 10:19 AM
Post #4

D.I.C Head
**

Joined: 7 Nov, 2005
Posts: 191



Thanked: 1 times
My Contributions
Check the form names. When you pasted the code it may have changed the form name or you might have given the last form that had the mishap a different name. like myForm.vb
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Must Have Starup Form
20 Feb, 2007 - 10:28 AM
Post #5

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,984



Thanked: 44 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
If you are using VS 2003, then you need to open the Project properties which can be found under the Project menu on tool bar.

When it opens you will see a combo box labeled Startup. Drop down the list and set it to the name of your form.

That should solve the problem.
QUOTE

To change the startup object or startup form

1. With a project selected in Solution Explorer, on the Project menu, click Properties.

2. Click the Application tab.

3. Select a Startup object from the Startup object or Startup form drop-down list.

User is offlineProfile CardPM
+Quote Post

Schwarzenegger
RE: Must Have Starup Form
20 Feb, 2007 - 02:55 PM
Post #6

New D.I.C Head
*

Joined: 20 Feb, 2007
Posts: 13


My Contributions
QUOTE(jstephens @ 20 Feb, 2007 - 11:19 AM) *

Check the form names. When you pasted the code it may have changed the form name or you might have given the last form that had the mishap a different name. like myForm.vb



I got it going again. The Startup Object in the Project Properties box was set to Main(). Once I set it to my form name all was OK. Simple when you know what you are doing. We live and learn.
Thank you all for your great and prompt help.
Cheers,,

Schwarzenegger
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 03:19PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month