Force access application on top (1 Viewer)

brampeirs

Registered User.
Local time
Today, 22:26
Joined
Jul 29, 2011
Messages
20
Hello,

I have a timer that check's for a boolean, if the boolean is true a form pops up. This works, but when users have the application minimized, they can only see the popup when they return to the application. So here's my question: is it possible with VBA that when the form pops up, the access application is activated. So the application gets focred to show up so the popup is visible.

(It's like reminders in outlook)

Thank you very much
 

vbaInet

AWF VIP
Local time
Today, 21:26
Joined
Jan 22, 2010
Messages
26,374
One of the following:
Code:
    Application.RunCommand acCmdAppRestore
    Application.RunCommand acCmdAppMaximize
 

brampeirs

Registered User.
Local time
Today, 22:26
Joined
Jul 29, 2011
Messages
20
One of the following:
Code:
    Application.RunCommand acCmdAppRestore
    Application.RunCommand acCmdAppMaximize

Thank you, it worked!!! :)
 

brampeirs

Registered User.
Local time
Today, 22:26
Joined
Jul 29, 2011
Messages
20
Turns out I have another problem, when I minimize the application the code works. But most users use ALT + TAB to switch between application, an then the code does not work (because the application is not minimized but between another application) . Is there code to fix this issue?

Again thank you!!!
 

vbaInet

AWF VIP
Local time
Today, 21:26
Joined
Jan 22, 2010
Messages
26,374
You will need an API call. I think SetForegroundWindow or SetActiveWindow APIs should do. Search online for these.
 

brampeirs

Registered User.
Local time
Today, 22:26
Joined
Jul 29, 2011
Messages
20
Thank you, found this: vbforums.com/showthread.php?t=352702 and it works.
 

Users who are viewing this thread

Top Bottom