Set Form Focus

  • Thread starter Thread starter Kevin D.
  • Start date Start date
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.
 
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.
 
Back
Top