Solved

Exit VB program...

Posted on 2000-03-13
5
378 Views
Last Modified: 2010-05-02
It will be very much appreciated if anyone VB expert will help me this.
Many Thanks in advance.

I had this VB Database updating program call sample.exe,
What can I do to let the program go directly to the VB runing interface rather than VB design form once I click on my sample.exe file.

Rgds

Felicia
0
Comment
Question by:felicia
[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
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:pacificdb
ID: 2614660
Your question is a bit confusing to me, however, if you mean that the wrong form is displayed when you execute your program, here is what you should do.

1. Open your VB project in design mode.

2. From the Project menu, select 'Project Properties'.

3. From the 'Startup Object' dropdown list, select the name of the form you want to see when you execute your program.

4. Click OK.

5. From the File menu, select 'Make Sample.exe'.

6. Exit VB, then execute your program again.

I hope this helps.
0
 

Author Comment

by:felicia
ID: 2614827
Pardon for the confusion.

I had done what u mention.

U see, when I execute the sample.exe, it displays the form. I need to click the run icon to enter into the runing mode, then I could updating by price through clicking the updating comand button...cmdUpdate.Click()

Instead of display the form when I execute the VB project sample.exe,
I would like it to display in the running VB mode that I could directly
click the cmdUpdate.Click() command button.

Can that be done???

Many Thanks
0
 
LVL 5

Accepted Solution

by:
KDivad earned 0 total points
ID: 2614862
Is this what you mean?:
Right-click the project file and select "Run" instead of the default "Open". This will load the project and cause VB to immediately begin running it.
0
 

Author Comment

by:felicia
ID: 2614900
Great !!! Thanks !!!

That's what I want.

Sorry, again what command could I used to quite to windows mode instead of VB form after running the update.

Am using a quit command button as follows:

Private Sub cmdQuit_Click()
End
End Sub

The purpose of me using this approach is to allow end user directly using the updating program rather than using entering VB program that they may not be familier with.

Many Thanks agin

Felicia
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2618598
There isn't a correct way to do it. However, you may be able to use a method simliar to one I used in VB3. I used Appactivate to switch the focus to VB's main window and SendKeys to send the "Alt-Space C" that would close VB.  DO NOT SET THE "WAIT" PARAMETER FOR SENDKEYS TO TRUE! This method is loaded with difficulties, but may help you figure out some way to do it.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 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