Minimize

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

Guest

This is probably a really easy question but here goes

How would I minimize the main control window/form (the one which contains the table, forms, macros, reports.....) how is it refered to in VBA??

I know I'll use a DoCmd.Minimize but first I have to setfocus on it but I don't know what it is called

thank you for your help yet again

Daniel
 
Hi Daniel

The following code should do it for you, and no, it's not 'really easy' as you
suggested

Hope this helps

Best regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
Ottawa, Ontario




Create a new module and type the following lines
in the Declarations section:

Option Explicit

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

2. Create the function MaximizeAccess():

Function MaximizeAccess()
Dim Maxit%
Maxit% = ShowWindow(hWndAccessApp, SW_SHOWMAXIMIZED)
End Function

3. Create the function MinimizeAccess():

Function MinimizeAccess()
Dim Minit%
Minit% = ShowWindow(hWndAccessApp, SW_SHOWMINIMIZED)
End Function

4. Create the function RestoreAccess():

Function RestoreAccess()
Dim Restoreit%
Restoreit% = ShowWindow(hWndAccessApp, SW_SHOWNORMAL)

End Function

5. The following sample macro action will minimize the Microsoft Access
window:

Action FunctionName
 
Daniel said:
This is probably a really easy question but here goes:

How would I minimize the main control window/form (the one which contains the table, forms, macros, reports.....) how is it refered to in VBA???

I know I'll use a DoCmd.Minimize but first I have to setfocus on it but I don't know what it is called!


If you mean you just want to minimize the Database Window
and not all of Access, then use this:

DoCmd.SelectObject acTable, , True
DoCmd.Minimize
 
I need a little clarification

1. Are the functions created in the same module as the "Option Explicit" code

2. I want to use the function in VBA code and not in a macro. Can I call the function there? How

Thank you for your help

Daniel
 
Back
Top