?
Solved

Sub Main Error

Posted on 2010-11-30
7
Medium Priority
?
321 Views
Last Modified: 2012-05-10
I've been working on an application for a while. It's main form is called "frmPacingManagement" and I have that form set up to load in the "Startup Object" drop down on the Application Tab.

When I try to run the application, I get an error: "Error      1 'Sub Main' was not found in 'TBOPacing.frmPacingManagement'." I don't have an object called Sub Main, but when I go to the Startup Object drop down box, Sub Main appears there at the top of the list.

Is "Sub Main" some kind of hidden routine that is supposed to be in my code?       

Thanks.
0
Comment
Question by:Buck_Beasom
[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
  • 3
  • 3
7 Comments
 
LVL 13

Assisted Solution

by:gamarrojgq
gamarrojgq earned 1000 total points
ID: 34239832
Hi,

The Sub Main Method is the primary entry point for a Console Application, Windows Form Application do not need this method since you can set a Form as your primary entry point.

If you have been working on your application before, perhaps you change your Project Type and that could be the reason that is asking for the Sub Main method.

Hope that helps
0
 

Author Comment

by:Buck_Beasom
ID: 34239940
Apparently I have busted something even larger. The very top row of my code used to read "Public Class frmPacingManagement." Went back in and looked at it and it said "Public Class pnlSalesTeamTitle" - which is really not supposed to be a class at all. It is just a panel on my form. I changed the top line back to what it was originally, but now it is throwing HUNDREDS of errors. The first one appears in the attachment.

I am new at this, and one of the problems I have been having is that I sometimes find myself changing properties for an incorrectly selected object. It happens alot with panels. So I'm thinking that I did something bizarre with the pnlSaleTeamTitle and cause it to stomp all over my code.

Any suggestions will be appreciated.
VB-ClassError.bmp
0
 

Author Comment

by:Buck_Beasom
ID: 34240109
I think I know what is busted. I just need some advice on how to fix it.

When I go to work on my form "frmPacingManagement" I can no longer get to the designer - I can just see the code. But when I look in the Class Diagram, there is now a class there called "pnlSalesTeamTitle" - and when I open it, it has all of the design code in there. So somehow I renamed something or otherwise trashed its attributes so that my frmPacingManagement is broken into 2 pieces - the event codes and the design code.

What do I have to do with the "pnlSalesTeamTitle" to get my form back together?  The top rows of code are this:

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class pnlSalesTeamTitle
    Inherits System.Windows.Forms.Form

If I change "Partial Class pnlSalesTeamTitle" back to "Partial Class frmPacingManagement" will I get things back together?

Thanks.
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
LVL 13

Expert Comment

by:gamarrojgq
ID: 34240223
Ok,  make a backup of your project just in case. Close Visual Studio and open a windows explorer in your application folder.

You should have 3 files for your form:

frmPacingManagement.vb  THAT HAVE YOUR CODE
frmPacingManagement.Designer.vb THAT HAVE YOUR CONTROLS DEFINITIONS
frmPacingManagement.resx  THAT HAVE AND BINARY DATA SUCH YOUR IMAGES

Open the file frmPacingManagement.Designer.vb and post its content, also do the same for the frmPacingManagement.vb, so we can try to figure it out what happend.
0
 
LVL 13

Expert Comment

by:gamarrojgq
ID: 34240261
Well, backup you application, and do that change, it will try to join both classes since they are PARTIAL CLASS
0
 
LVL 17

Accepted Solution

by:
Zhaolai earned 1000 total points
ID: 34240445
>If I change "Partial Class pnlSalesTeamTitle" back to "Partial Class frmPacingManagement" will I get things back together?<
Yes, it should bring your form back to normal.
0
 

Author Closing Comment

by:Buck_Beasom
ID: 34240708
Well, thank heavens it turned out to be that simple. Since both of you helped (and Zhaolai not for the first time!) I am splitting the points.

Many thanks!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

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