Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Database Window 2

Status
Not open for further replies.

jpro

MIS
Mar 8, 2002
21
US
I am trying to hide everything relating to MSAccess besides the forms\reports that the user is using.

I have gone into startup and set the form I want the users to use in the display field and removed all check box items completely. When the database is opened the main form opens as I want it to, but there is still a MSAccess window with no menus hiding in the background.

Is there a way to remove it?

Great minds discuss "Ideas"
Average minds discuss "Events"
Below Average minds discuss "People
 
Yes, all check boxes are unchecked in the startup options.

Great minds discuss "Ideas"
Average minds discuss "Events"
Below Average minds discuss "People
 
I designed an application in Access 2000 using the code to hide the database window. The application opens to the Switchboard. All work just fine except the REPORTS menu. Clicking on a report, nothing happens. I have tried several options, including creating a new form just for the reports and still no luck. Any ideas about what is happening and how to fix? Thanks much

 
Did you set your form's property popup = Yes, or your reports property popup = Yes?
 
Try this (the reports don't work in this either)
faq702-5449

or


I found this, which I thought came from the FAQ but I can't seem to find it. So appologies to the author 'wildmage' where ever you are from.
Hide The Access Window
faq705-2562
Posted: Oct 10, 2002 (Edited Sep 9, 2003)
I have answered many people on the ability to "hide" the Access window....that is, the grey box that is the Access program itself.

This can be done. It involves a bit of coding and some property changes, but in the end, it will give you a very professional appearance. But you will lose the ability to use any of the menus that are in Access. So if you need any of the menu functions, you will have to include them in your forms....

Below lists the steps to make all this work:

1. Copy the code at the bottom of this FAQ into a module. I named mine basAccessHider, but it really doesn't matter.

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)

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. Now the property changes.....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 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"

5. Finally, to allow reports to be previewed...in every report you will need to put:

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


''''''''''''''
' Start Code '
''''''''''''''
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
''''''''''''
' End Code '
''''''''''''

Ian Mayor (UK)
Program Error
There's ALWAYS more than one way to skin a cat!
But only one way to get it RIGHT!
 
Is there anywhat to use the code shown in this thread and still run reports? Mine won't show up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top