Solved

Why my second form is missing after using another application in Visual Basic 6

Posted on 2014-07-22
4
209 Views
Last Modified: 2014-07-22
Hi guys,

I have form-A and Form-B, the form A is my main form and has the menu and also remains visible until the application is closed, when I choose an option from main menu, the program opens Form-B that becomes the active window and the main form becomes disabled. When I close Form-B, the Form-A becomes enabled again, so everything works perfect.

The problem is when I use another application let's say:

I have my main form-A and my form-B running suddenly, I open MSWord to do something and it becomes the active window, at this point everything is ok, but when I return to my Application, the form-B is missing and only see the Form-A, but disabled. So Where is my Form-B?

Thank you so much guys in advance.
0
Comment
Question by:elm9999
4 Comments
 
LVL 15

Expert Comment

by:Ess Kay
Comment Utility
the form b is in the background

What you should do instead of disabling it is to hide it
Set form1.visible = false

Or use it like an MDI

if you minimise word, you will see form2 is still there, behind it
0
 
LVL 21

Expert Comment

by:Randy Poole
Comment Utility
You can also on the form_show of form a
if  not forma.enabled then formb.show
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
When you display the second form, display it as modal and specify the current form as the owner:
http://msdn.microsoft.com/en-us/library/aa244181(v=vs.60).aspx
Private Sub cmdShowResults_Click()
   ' Show a modal form named frmResults.
   frmResults.Show vbModal, Me
End Sub

Open in new window

0
 

Author Closing Comment

by:elm9999
Comment Utility
Thank you so much guys.

Its' already done with Mike option.

Thank's
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 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

10 Experts available now in Live!

Get 1:1 Help Now