Bring an Access form to the front via VBA

S

Simon Baker

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
 
G

Graham R Seach

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
 
S

Simon Baker

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
 
Top