Minimize

D

Daniel P

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
 
S

StCyrM

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
 
M

Marshall Barton

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
 
D

Daniel P

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
 

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