Set Form Focus

K

Kevin D.

I have a command button on "Form 1" which when clicked minimizes form 1 and
opens "Form 2".

When I close "Form 2" I use the following code in the on close function of
"Form 2" to restore "Form 1":

DoCmd.SelectObject acForm, "Form 1", False
DoCmd.Restore

This restores "Form 1" but does not set the focus to "Form 1". How can I
restore Form 1 and set the focus to it?

Thanks

Kevin D.
 
K

Ken Snell MVP

Assuming you have just the two forms open when your code runs:

Me.Visible = False
DoCmd.Restore


Above code will make Form2 invisible, thereby setting focus to Form1.
 

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

Similar Threads


Top