Solved

Automatically close a program after running

Posted on 2004-08-27
5
316 Views
Last Modified: 2010-05-02
Hi,

I wrote a VB program, and the process goes like this:

On Form_Load
   subRead_the_ini_file
   cmdActivate_click
End sub

Actually after cmdActivate_click I would like the program to just close up, but I realize as I put the click event under the Form_load, although on activate the program it will automatically run the functions under the click event, but after it is comleted, the form will show up in the screen.

I'm planning to put this program in a server and let it automatically run every nite, so nobody will be there to close this program. How can I make it close?

Thanks,
sata
0
Comment
Question by:sata
[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
5 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 11911037
try put "End" just after cmdActivate_click ?

like:

...
cmdActivate_click
End
Exit Sub
...
0
 
LVL 3

Accepted Solution

by:
rinksno1 earned 50 total points
ID: 11911053
at the cmdActivete_click() event type

cmdActivate_click
...
..

unload me        'will exit from your own program after the process of cmdActive
Exit Sub
0
 
LVL 1

Expert Comment

by:sanjeev_karnik
ID: 11911077
After the execution of the code in Activate event call the form unload event and close the application there.
0
 
LVL 18

Expert Comment

by:JR2003
ID: 11911088
In your cmdActivate_click you jusst need the following line:

Unload Me

And the program will finish and the form won't show up
0
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11911105
Add a timer control on form, disable it, set Interval on 500, instead of cmdActivate_click put Timer1.Enabled =True

private sub Timer1_Timer()
  timer1.enabled = false
  unload me
end sub
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses
Course of the Month7 days, 13 hours left to enroll

632 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