Solved

Enable/Disable Forms

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

773 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