Solved

one more question

Posted on 2003-10-22
3
137 Views
Last Modified: 2010-05-03
what's mean by "Sub Main" was not found.
0
Comment
Question by:gegou
3 Comments
 
LVL 19

Accepted Solution

by:
Desp earned 125 total points
ID: 9602053
you are having problems with the start up form
from the projects menu --> Project1 Properties --> Startup object.
select a start up Form from here
and re run the project
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 9602058
In the VB IDE, open a project file.  On the menu, click on Project, then select the last item in the list to view the project properties.  (It will say Project1 Properties if the project is called Project1).

On the general tab, there is a place to tell the project where to start code execution.  By default, it is Form1, which means code will start at

Private Sub Form_Load()
    MsgBox "Started from Form_Load()"
End Sub

on Form1.  If you change it to Sub Main then you must have a MODULE with a sub called main in it.

Public Sub Main()
    MsgBox "Started from Main()"
End Sub  

Hope this helps.
0
 
LVL 4

Expert Comment

by:brother7
ID: 9602065
It means that when you tried to compile your project, it couldn't find the subroutine Main.  You should have a Main subroutine, as this is the entry point in console applications.  When this error appears in the Task List, click on it.  You will be given a chance to specify the module/Main location.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add text to end of existing text in file 16 69
Excel object stays open 19 71
String manipulation in Visual Basic 7 59
Problem to With line 4 41
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now