I have just created a form and made it to stay on top of non-Microsoft Access forms and windows using examples modules here: http://support.microsoft.com/kb/210500. Which works fine.
But the problem occurs when a message box is populated on the form; it appears at the back of the active form.
Can one genius tell how to make the msg box appear on top of the active form as usual.
I know that this is a result of the modules making active form to stay on top of the msgbox but can one smart person know any way around this to make the msgbox stay on top of the form?
For those who are interested in the code module:
This is how I did it.
I created a module called FormsOnTop:
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Option Explicit
- '.........................................................................
- Declare Function 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) As Long
- Global Const HWND_TOPMOST = -1
- Global Const SWP_NOSIZE = &H1
- Global Const SWP_NOMOVE = &H2
- Function TopMost(F As Form)
- Call SetWindowPos(F.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
- SWP_NOMOVE Or SWP_NOSIZE)
- End Function
Popup: Yes
OnTimer: =TopMost(Form)
TimerInterval: 50
I have absolutely know idea on how to make the msgbox appear ontop of the form.
Hope someone helps..
Thanks
Jerry