Need message box to be at front of screen

  • Thread starter gsnidow via AccessMonster.com
  • Start date
G

gsnidow via AccessMonster.com

Greetings all. I have set a timer on a form which has a message box that
pops up at defined intervals telling the user they are still being timed.
The problem is that if they are using another application with access
minimized, the message box is not visible until they minimize all other
applications that are on top of it. Is there a way to make the message box
show on top of all other open applications? I am using Access 2003 with XP
Pro. Thank you.
 
J

Jeff Boyce

If you are using the Access application to pop up an Access messagebox, I
suspect it will only show when Access is the active app.

What alternate messaging options (other than Access) have you researched?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
M

Mike B

You could use the Windows API message box, which is the grandfather of the
message box used in Access. It takes a window handle as an argument so you
can make it modal to your current window.

http://msdn.microsoft.com/en-us/library/ms645505(VS.85).aspx

TESTED:
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" _
(ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, _
ByVal wType As Long) As Long

Option Compare Database


Private Sub Command0_Click()
Dim ar As Long
Dim currentHWND As Long

currentHWND = Me.hwnd

' I think you can use the vb / vba constants as the last arguments in the
function
' if not, declare the constants you find at the MSDN site and use those.

ar = MessageBox(currentHWND, "Msgbox using API", "Arungg", vbInformation)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top