SetFocus doesn"t bring opened form to top after first time
am 12.10.2007 14:34:21 von Denise
I have several big forms that are Maximized on Load. I have "Jump"
buttons on each to flip to other related forms.
- 'Needs' form has jump button to it's linked Project, if it is linked
- Project form has jump button to it's Decision Record form and vice-
versa
- Project form has jump button to the Needs form for each of its
linked 'Needs'
The first time you click any jump button the called form comes up and
fills the screen. But once you have all three main forms open (Need,
Project, DecRec) then the SetFocus part still works fiine, but it just
doesn't pull that form to the 'top of the pile'. User has to click
the form button down in the tray at the bottom of the screen.
I've tried DoCmd.SelectObject acForm, "frmMainProject", vbYes (and
also tried vbNo)
after the SetFocus but that wasn't the trick.
Users who have dual monitors can set the windows to non-maximized and
drag one form to the left hand monitor and one form to the right hand
monitor, showing two at once, and things are ok. Users who only have
one monitor would like the form they jumped to to fill the screen.
Any ideas?
Thanks! Denise
Re: SetFocus doesn"t bring opened form to top after first time
am 12.10.2007 16:52:18 von Tom van Stiphout
On Fri, 12 Oct 2007 05:34:21 -0700, Denise wrote:
I would try the BringWindowToTop API:
Public Declare Function BringWindowToTop Lib "user32" Alias
"BringWindowToTop" (ByVal hwnd As Long) As Long
BringWindowToTop Me.hWnd
-Tom.
>I have several big forms that are Maximized on Load. I have "Jump"
>buttons on each to flip to other related forms.
>- 'Needs' form has jump button to it's linked Project, if it is linked
>- Project form has jump button to it's Decision Record form and vice-
>versa
>- Project form has jump button to the Needs form for each of its
>linked 'Needs'
>
>The first time you click any jump button the called form comes up and
>fills the screen. But once you have all three main forms open (Need,
>Project, DecRec) then the SetFocus part still works fiine, but it just
>doesn't pull that form to the 'top of the pile'. User has to click
>the form button down in the tray at the bottom of the screen.
>
>I've tried DoCmd.SelectObject acForm, "frmMainProject", vbYes (and
>also tried vbNo)
>after the SetFocus but that wasn't the trick.
>
>Users who have dual monitors can set the windows to non-maximized and
>drag one form to the left hand monitor and one form to the right hand
>monitor, showing two at once, and things are ok. Users who only have
>one monitor would like the form they jumped to to fill the screen.
>
>Any ideas?
>Thanks! Denise