Minimize a form

G

Guest

have a form as a popup. I guess you might be able to use a modal...Anyhow I
use it for a menu. Command buttons that take me to other forms...etc.

Question: I have enable the minimized button on the form. Is it possible
that when I minimize my form that access minimizes with it. I have noticed
that when I minimize the form because I want to go to my windows desktop that
I have to actually minimize twice...Once for the form that is loaded and the
second time to minimize access. Can this be done, and if so please let me
know.

Thanks.
 
G

Graham R Seach

Brian,

Place the following into a standard module:
Private Declare Function IsIconic Lib "User32" (ByVal hWnd As Long) As
Integer

Then place the following into your form:
Private Sub Form_Resize()
If (IsIconic(Me.hWnd) * -1) Then
DoCmd.RunCommand acCmdAppMinimize
End If
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
G

Graham R Seach

Brian,

Sorry, change the API declaration from Private to Public:
Public Declare Function...

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

Top