Minimize A Form

G

Guest

Good afternoon,

I hope some one can help. I am working with a form which is used for
calculating lots of different values. In order to completely maximize the
space available, I have set popup to true and used a simple maximize command
when the form opens. The problem I have is that the whole routine is very
time consuming and so, rather than sit on the form, I would like to be able
to minimize the whole database so that it can left running in the background.


I have used the command minimize but it only works for the form and not the
whole database. Ideally, I need to activate something like Show Desktop, so
that the user could work on something else.

Any ideas ??
 
G

Guest

I have listed below 3 subs that Restore, Maximize and Minimize the Access
Application Window.

Option Compare Database
Option Explicit

'declarations for application window manipulation
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow
As Long) As Long
Public Sub RestoreAccess()

On Error GoTo err_RestoreAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWNORMAL)

exit_RestoreAccess:
Exit Sub

err_RestoreAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_RestoreAccess

End Sub
Public Sub MaximizeAccess()

On Error GoTo err_MaximizeAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWMAXIMIZED)

exit_MaximizeAccess:
Exit Sub

err_MaximizeAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_MaximizeAccess

End Sub
Public Sub MinimizeAccess()

On Error GoTo err_MinimizeAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWMINIMIZED)

exit_MinimizeAccess:
Exit Sub

err_MinimizeAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_MinimizeAccess

End Sub

Hope this helps.
 
G

Guest

Exactly what I wanted, thank you Andrew

Andrew Tapp said:
I have listed below 3 subs that Restore, Maximize and Minimize the Access
Application Window.

Option Compare Database
Option Explicit

'declarations for application window manipulation
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow
As Long) As Long
Public Sub RestoreAccess()

On Error GoTo err_RestoreAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWNORMAL)

exit_RestoreAccess:
Exit Sub

err_RestoreAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_RestoreAccess

End Sub
Public Sub MaximizeAccess()

On Error GoTo err_MaximizeAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWMAXIMIZED)

exit_MaximizeAccess:
Exit Sub

err_MaximizeAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_MaximizeAccess

End Sub
Public Sub MinimizeAccess()

On Error GoTo err_MinimizeAccess

Dim lngReturn As Long

lngReturn = ShowWindow(hWndAccessApp, SW_SHOWMINIMIZED)

exit_MinimizeAccess:
Exit Sub

err_MinimizeAccess:
MsgBox "Time:" & Space$(11) & Format(Now(), "dd/mm/yyyy hh:nn:ss") &
vbCrLf & "Number:" & Space$(6) & Err.Number & vbCrLf & "Source:" & Space$(8)
& Err.Source & vbCrLf & "Description: " & Err.Description, vbCritical +
vbOKOnly, "Error"

Resume exit_MinimizeAccess

End Sub

Hope this helps.
 

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