Solved

Remove the Access program window when database is opened default

Posted on 2008-11-01
5
251 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now