Solved

Enable/Disable Forms

Posted on 2002-07-08
2
135 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

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

757 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

14 Experts available now in Live!

Get 1:1 Help Now