JP said:
How do I make a dialog box system modal as opposed to application
modal? I want the dialog box to pop up even if Access is minimized
or behind another application. Is this possible in Access?
It appears the modal attribute of a form is application modal and
does not help if the application is minimized.
I'm not sure how to make the form system modal, but I know a way to pop
it to the top even if Access is minimized or hidden. Try something like
this:
'----- code for standard module -----
Option Compare Database
Option Explicit
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" ( _
ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long)
Sub OpenFormOnTop(FormName As String)
DoCmd.OpenForm FormName
SetWindowPos _
Forms(FormName).hWnd, _
HWND_TOPMOST, 0, 0, 0, 0, _
SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
'----- end code -----
Then open your form to the top of everything by writing
OpenFormOnTop "YourFormName"