Hide Access Window

  • Thread starter Thread starter Jasper Recto
  • Start date Start date
J

Jasper Recto

I found this code on the Internet to hide the access window (Below). I'm
suppposed to create 2 macros that Hide the window and Show the window

mcrHide fAccessWindow ("Minimize", False, False)
mcrShow fAccessWindow ("Show", False, False)


On the Startup form, I set the On Open option to mcrHide.

To preview reports, I set the On Open option to mcrShow and the On Close
option to mcrHide

The problem I'm having is that when I preview the reports, I don't have the
option to print them becuase the menu bar is hidden.

Looking at the code below, is there a way to make it so that the print
option appears for the user to print?

Thanks,
Jasper


''''
' 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 '
 
Try going to your start up form and click on the Access built in Toolbars
checkbox, click OK and then close out of the database to reset.
 
Ok, two things:

1. Am I correct in saying that for you to have these macros to hide and
unhide the active window, you do not have a form like a switchboard or main
menu that pops up when you open the database?

2. In the start up box, under Shortcut Menu bar does it say (default) in the
drop down box? If not, try changing it to that.

Also, if number one is correct, you may want to think about adding that form
and do away with the macros because they may be preventing the toolbars from
showing. I don't know for certain as I never had this problem, just taking an
educated guess.
 
Actually, I do have a switchboard that pops up. Even with the switchboard,
I need the macro to hide the access window when it opens up. Is there
another way hiding the access window without the macro?

All options are checked in the startup options and the Shortcut Menu is set
to default but I still can't get the menus at the top of the print preview.

Thanks,
Jasper
 
Here is a wild shot in the dark.

1. Make a copy of your database.

2. Open the database and then open the startup form.

3. On the Display Form/Page field, click the drop down box and select your
switchboard and delte your macros that hide and unhide. (again, make sure you
are doing this in the copy NOT your original)

4. Close out of everything and exit the database. When you open the database
again, your switchboard should pop up and through that, you should be able to
get what you need (forms, report etc..) depending on how you set it up. Also,
when you need to work on a table, query, form, report, before clicking on the
open button, hold down the shift key while clicking the open button and wait
for the database to open before you let go.

Now, if you are still having a problem with the toolbar (I have never had
this happen so I am not sure why this is happening to your database), create
a new database and store it on your desktop for now.

Then in the active window, right click and select Import. When the box
appears, select your current database and click import or select and a window
with tabs will open. The tabs will read Table, Forms, Query and so on. select
everything you need from that database BUT NOT THE MACROS. Then close
everything out and exit the databases. Open the new one you just imported
everything to and follow my instructions above for the startup menu. This
should reset everything to normal unless you have some specific code in a
module or something that is preventing the database to show the toolbars.

Hope this helps!!!!
 
Back
Top