Out of Focus

G

Guest

In an effort to speed up the program I open main forms once and turn their
visibility off when navigating to other forms. However, if the user choses to
open a form related to the main form, I will leave the main form visible
behind the related one. Here is the problem. When I close the related form,
the main form becomes active, the band at the top turns bright blue, but the
Form_Activate event does not seem to execute; neither does the Form_GotFocus.
(I have put breakpoints on their End Sub lines). Even clicking on a text box
fails to kick them off. So I have two questions. Is there another event that
triggers when the form on top is closed and the one behind becomes "active"?
Should the answer to this be no, is there a way to execute code in the main
form from the code used to close the related form? Thanks.
 
G

Guest

Michael,

If you read up on the GotFocus event you will discover that it is not
triggered for a form if that form contains one or more controls capable of
accepting the focus. Put another way it is only triggered for a form if the
form has no enabled controls. This is part of the answer to your post.

I cannot however understand why the Activate event does not fire. It always
has for me.

Regards,

Rod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top