Solved

Enable/Disable Forms

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

713 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