How to select a form which is already open

I

Irshad Alam

I tried the below code to select the form (Form1), which
is aready open, but it does not function :

Private Sub Label113_Click()

DoCmd.OpenForm "Form2", acNormal
DoCmd.SelectObject acForm, "Form1", True

End Sub


Please note that I made the Label113 on Form1 to click on
that to open another Form (Form2) and get back the focus
to Form1

Could any one please correct my code or advise.
 
A

Allen Browne

To set focus to a form that is already open:
Forms("Form1").SetFocus

That should work unless something is opened as dialog/popup/modal.
 

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