Bring an Access form to the front via VBA

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
 
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
 
G

Guest

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
 

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

Similar Threads


Top