Solved

Enable/Disable Forms

Posted on 2002-07-08
2
139 Views
Last Modified: 2011-09-20
I have a situation:
I am opening a form(FormA) ,and without closing it ,I want to open another form (FormB).
And until I not finished with FormB ,I can't return to
FormA.(Disable to set focus on it)
I am writing:

   FormA.Show
      .
      .
      .
   FormB.Show
   FormA.Enable=False (On Loading FormB)
      .
      .
 
   FormA.Enable=True (On Unloading FormB)
And its' working .
But if I have a main MDIForm it's
not working like I want (when I click on FormA ,VB set
focus on it)
What can I do ,that it will work like without MDI form ?  

0
Comment
Question by:Vlad77
2 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 7138892
You can make the shown form modal to prevent access to the calling form until the called form finishes:

'Form1
Form2.Show vbModal
' more code that won't get executed until Form2 unloads...
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 100 total points
ID: 7138895
MDI Forms are not designed to operate like this.  If you want your application to only activate one form at a time, you can use normal forms and do this:

(From FormA)

FormB.Show vbModal

This will load and display formb, and the user will not be able to use form A until FormB is at least hidden (or unloaded which is usually better in this kind of application.)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

809 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