468,248 Members | 1,533 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,248 developers. It's quick & easy.

Sub Main not found error.

Hi Folks,

I wonder what I need to do.

I make a REAL simple design,

One losuy form that has an allocated 'Name' property - Form1

I build solution without an issue.

However, if I change the 'Name' property to say... "Adder" and do the
same build I will receive an error:

'Sub Main' not found was not found in 'Adder.Form1'

I can't find any reference to 'Adder.Form1' nor Sub Main.

How would I correct the thing, rather than accept "FORM1" as a
permanent 'Name' property value. Can I not change any of the Form
names as I choose?

Thanks -- paul

Jul 17 '05 #1
3 10054
> I wonder what I need to do.

I make a REAL simple design,

One losuy form that has an allocated 'Name' property - Form1

I build solution without an issue.

However, if I change the 'Name' property to say... "Adder" and do the
same build I will receive an error:

'Sub Main' not found was not found in 'Adder.Form1'

I can't find any reference to 'Adder.Form1' nor Sub Main.

How would I correct the thing, rather than accept "FORM1" as a
permanent 'Name' property value. Can I not change any of the Form
names as I choose?


Of course you can rename a Form any time you want. This is only a guess;
however, it sounds to me like you removed Form1 from the project
somewhere along the line and then added it back in some time later on
(renaming it to Adder at that time). If this is correct, then when you
removed Form1, VB would have automatically made (an assumed to be
defined) Sub Main as the Startup Object (because it needs something to
be defined as the Startup Object). When you added Form1 back into the
project, VB would **not** have reset the Startup Object. I think this
would produce the error you are seeing.

Whether my guess above is correct or not, you should be able to
straighten things out by clicking on Project/Properties in VB's (the
IDE's) menu and selecting your current form's name in the ComboBox
labeled StartUp Object (which should now read Sub Main) on the General
tab.

Rick - MVP

Jul 17 '05 #2
On Mon, 13 Dec 2004 10:34:40 -0500, Paul Bruneau <bruneaup@SPAM
rogers.com> wrote:
Hi Folks,

I wonder what I need to do.

I make a REAL simple design,

One losuy form that has an allocated 'Name' property - Form1

I build solution without an issue.

However, if I change the 'Name' property to say... "Adder" and do the
same build I will receive an error:

'Sub Main' not found was not found in 'Adder.Form1'


I think this might be FRED.NET
Jul 17 '05 #3

"Paul Bruneau" <bruneaup@SPAM rogers.com> wrote in message
news:43********************************@4ax.com...
Hi Folks,

I wonder what I need to do.

I make a REAL simple design,

One losuy form that has an allocated 'Name' property - Form1

I build solution without an issue.

However, if I change the 'Name' property to say... "Adder" and do the
same build I will receive an error:

'Sub Main' not found was not found in 'Adder.Form1'

I can't find any reference to 'Adder.Form1' nor Sub Main.

How would I correct the thing, rather than accept "FORM1" as a
permanent 'Name' property value. Can I not change any of the Form
names as I choose?

Thanks -- paul


When you first create a project, VB thinks Form1 is the startup object
when you change the name of Form1, you need to right-click the project in
the solution explorer, click 'properties' and set the startup object to the
new name of your form

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.807 / Virus Database: 549 - Release Date: 12/8/2004
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marco Vezzoli | last post: by
3 posts views Thread by Pavel | last post: by
6 posts views Thread by unlikeablePorpoise | last post: by
80 posts views Thread by Ioannis Vranos | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.