Active forms

J

John

Hi

Is there a way to find out the form that is currently open, active and has
focus?

Thanks

Regards
 
V

Van T. Dinh

If you used A2K or later:

CurrentProject.AllForms("FormName").IsLoaded

will return True (Form is open / loaded) or False.

Screen.ActiveForm

will return the Form Object of the active Form. If you want to know the
name of the active Form:

Screen.ActiveForm.Name

A Form *must* be active for a Control on the Form (or the Form itself *only
if* there are no focusable Controls on the Form) to have the Focus. So, in
most cases, a Control on the Form has the Focus, not the Form. If you want
to find the Control that has the Focus, you can use:

Screen.ActiveControl
 

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