[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Child forms & focus

Posted on 1998-06-23
4
Medium Priority
?
263 Views
Last Modified: 2010-05-03
I use child forms to show dbgrids and when I want to add new records to the database I show a form with modal 1; when in that form I have to show an error I use msgbox and that's the problem; when I close the msgbox the focus goes to the modal form, but when I close that form the focus goes to another application and my application is minimized instead of going to the child form. How can I change that and get the focus in the child form but without loosing the focus my application. I'm ussing VB5. Thanks.
0
Comment
Question by:girona
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:raygibbins
ID: 1464030
When you show the child form try the following

frmChild.Show vbModal, Me

Where ME is the parent form

Do you have code that minimizes the parent form ?
0
 

Author Comment

by:girona
ID: 1464031
I've tried raygibbins solution and it doesn't work. I obtain an error about I can't show a child in modal way.
I don't have any code to minimize the main form, it minimizes itself when I show a msgbox and close the modal form.
0
 
LVL 9

Accepted Solution

by:
Dalin earned 400 total points
ID: 1464032
goirona,
This is a Microsoft bug.
Check out:
BUG: Focus Does Not Return to an MDI parent form
http://support.microsoft.com/support/kb/articles/q180/7/47.asp
There is the explanation and a resolution.
Regards
Dalin
0
 
LVL 1

Expert Comment

by:raygibbins
ID: 1464033
girona

Sorry did not realise it was an MDI application

Try setting the WindowState property of all MDIchild forms to
2 - Maximized , in the properties window.
Or set them in code to vbMaximized
     
When you show an MDIChild window, then all other MDIChild forms take on the same WindowsState as the Active MDIChild


0

Featured Post

Industry Leaders: 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

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…
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…
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…
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…
Suggested Courses

649 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