Forum Discussion
perrycheng
Dec 29, 2018Copper Contributor
MS Access force a popup on top of other windows?? Is this possible?
I am just wondering if there is a way to have access display a popup form (even just a message saying, "hey you got a new entry by an use!" ON TOP of another window (say, Chrome Explorer, or whateve...
perrycheng
Feb 05, 2019Copper Contributor
So, I found a codes below from somewhere, can't remember where. It works! However, it closes all my active forms. I really don't know what this module does for me, so, I don't know how to prevent it from closing my active open forms (it is a module, and then I just call it from an event):
Option Compare Database
Option Explicit
Public Declare Function SetForegroundWindow _
Lib "user32" _
(ByVal hwnd As Long) _
As Long
Public Function ActivateAccessApp() As Boolean
'Brings the DB to the front of all open windows
Dim appTarget As Access.Application
Set appTarget = GetObject(CurrentDb.Name)
ActivateAccessApp = _
Not (SetForegroundWindow(appTarget.hWndAccessApp) = 0)
Set appTarget = Nothing
End Function
Option Compare Database
Option Explicit
Public Declare Function SetForegroundWindow _
Lib "user32" _
(ByVal hwnd As Long) _
As Long
Public Function ActivateAccessApp() As Boolean
'Brings the DB to the front of all open windows
Dim appTarget As Access.Application
Set appTarget = GetObject(CurrentDb.Name)
ActivateAccessApp = _
Not (SetForegroundWindow(appTarget.hWndAccessApp) = 0)
Set appTarget = Nothing
End Function
DML1976
Feb 12, 2020Copper Contributor
perrycheng Is this still possible? The code I copied down doesn't seem to do anything.
Option Compare Database
Option Explicit
Public Declare Function SetForegroundWindow _
Lib "user32" _
(ByVal hwnd As Long) _
As Long
Public Function ActivateAccessApp() As Boolean
'Brings the DB to the front of all open windows
Dim appTarget As Access.Application
Set appTarget = GetObject(CurrentDb.Name)
ActivateAccessApp = Not (SetForegroundWindow(appTarget.hWndAccessApp) = 0)
Set appTarget = Nothing
End Function