Solved

Remove the Access program window when database is opened default

Posted on 2008-11-01
5
264 Views
Last Modified: 2013-11-27
I would like to know how to remove the Acess program window the default form that is loaded.

I have found ways of removing the tool bars and such to have  a nice window to run in.  However, the outside window border of Access is in the way.

It would be great to even have Access open minized and the form loaded on the screen.
0
Comment
Question by:Pivnardo
5 Comments
 
LVL 75
ID: 22860473
Don't think you can do that, but ... if there is a way ... most likely you will find it here:

http://www.mvps.org/access/search.htm

mx
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 22860528
Hi Pivnardo,

Have a look at Window Manipulation Examples
http://www.peterssoftware.com/winmanip.htm

Good Luck!

Gary
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 22860676
These are instructions I've picked up from another support site.
I would attribute them properly but the author didn't give his name.
The crucial elements are that all forms must be popups and you can't hide the Access window for reports.


1.  Copy the code at the bottom into a module.  
2.  Create a macro and call it mcrHide.  
  The Macro has one Action line - RunCode - and put the following in the Function box:
      fAccessWindow ("Minimize", False, False)    (Yes, this really is Minimize not Hide)

3.  Create another macro and call it mcrRestore.  
 The Macro has one Action line - RunCode - and put the following in the Function box:
      fAccessWindow ("Show", False, False)

4.  You have set every form in your database to PopUp....find the PopUp property for each form and set it to yes.  In the OnOpen event procedure of your startup form (if you don't have a startup form, just pick the first form you open when you open the database), put the following code:

      DoCmd.RunMacro "mcrHide"     (alternatively just select the macro name in the property box)

5.  Finally, to allow reports to be previewed you will need to create a 'restore' macro similar to the others,  and in every report you use:

      In the OnOpen:      DoCmd.RunMacro "mcrRestore"
      In the OnClose:     DoCmd.RunMacro "mcrHide"

(In other words , you MUST show the Access window for reports)



Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long

Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
     ByVal nCmdShow As Long) As Long
     
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
    If IsWindowVisible(hWndAccessApp) = 1 Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
End If
If StatusCheck = True Then
    If IsWindowVisible(hWndAccessApp) = 0 Then
        fAccessWindow = False
    End If
    If IsWindowVisible(hWndAccessApp) = 1 Then
        fAccessWindow = True
    End If
End If
End Function
0
 

Author Closing Comment

by:Pivnardo
ID: 31512446
Sorry for the slow responce.  Great information and really do appericate the responce even if all the information was not yours.  :)
0
 

Author Comment

by:Pivnardo
ID: 23023816
I can't believe Microsoft has made the ability to minimize the window arround the application so difficult.  I am surprised there is not a big "Microsoft" watermark across the entire page.  Like it isn't enough having to refinance you home to buy Office 2007.
The solution is much appericated and I extend my middle finger slowly to Microsoft on this one !
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question