Bring an Access form to the front via VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This sounds like it should be straightforward, but I cannot find any way of
doing this: put simply, I wish to bring a specified form to the front. I have
an Access app which has a client list, alongside the entries of which is a
'get record' button. When that button is clicked (everytime except the
first), the updated window stays behind the list window.

Any ideas?

Thanks in advance


Simon
 
Simon,

Put this into a standard module:
Public Declare Function BringWindowToTop Lib "user32" _
Alias "BringWindowToTop" (ByVal hwnd As Long) As Long

Put the following line of code into the form's Load event:
Call BringWindowToTop(Me.hWnd)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Perfect!

Many thanks


Simon

Graham R Seach said:
Simon,

Put this into a standard module:
Public Declare Function BringWindowToTop Lib "user32" _
Alias "BringWindowToTop" (ByVal hwnd As Long) As Long

Put the following line of code into the form's Load event:
Call BringWindowToTop(Me.hWnd)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top