Popup form

  • Thread starter Thread starter Paradigm
  • Start date Start date
P

Paradigm

Is there any way of forcing an Access popup form to have the focus. I have
an on timer event that pops up a form but if the user is using another
application e.g. IE the pop form is behind it and the user is not aware that
it is there.
thanks
Alec
 
Paradigm pretended :
Is there any way of forcing an Access popup form to have the focus. I have
an on timer event that pops up a form but if the user is using another
application e.g. IE the pop form is behind it and the user is not aware that
it is there.
thanks
Alec

if you open it in modal mode it will get the focus until you close it
again

grtz
 
Don't think that works unless the Access application is being used. If
another program e.g. Word is being used and the Access aplication window is
behind then the popup is also behind.
 
You need to use the WinAPI to force the Access Application to the top of the
zorder and then display the pop-up form.

If you download the zip file from
http://vb.mvps.org/samples/code/ForceFore.zip and then use the code in
ForceFore.bas in your own module.

From your forms timer event you can then ...
Call ForceForegroundWindow(hWndAccessApp)

.... to force Access to be the top level window, you can then open the form
you want to display.
 
Thanks. This works to an extent but is there any way of getting the single
popup form to appear on top without having the complete Access application
coming to the top. I am creating a task list system and I want new tasks to
appear as a popup form even when the main Access application is minimized or
behind other applications. The main form has a timer event to check for new
tasks.

Alec
 
Open the form and then call ForceForegroundWindow passing the forms hWnd
e.g.

Private Sub Form_Timer()
DoCmd.OpenForm "YourForm", acNormal
Call ForceForegroundWindow(Forms("YourForm").hwnd)
End Sub

For this to work best Access needs to be minimised.
 
Back
Top