Remove Access Menu Bar and Title Bar

How do you remove the Main Menu Bar from the main Access97 Parent Window.  Also is there a way to to eliminate the Main Access Title Bar or remove the Minimize, Maximize & Close buttons on the Main Parent Access97 Title Bar.
Who is Participating?
mb1akeConnect With a Mentor Commented:
This code hides the Access window using API calls so BE CAREFUL!  If you do not have a form that is a pop up form with an exit option you will have locked yourself out of that instance of Access.
Use at your own risk.  Create a module with the following code and then in the on open event of your pop up form type "fAccessWindow(Hide)"

Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long
Const SW_HIDE = 0
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
I think mb1ake has the answer you're looking for, I just wanted to elaborate.  If you don't want to hide all of access, you can create your own menu bar, assign that menu bar to your form, and make your form the startup form of the database.  But I don't think you can get rid of the Min/Max buttons on the menu bar.  If you do hide all of Access (using the fAccessWindow function in the above post), make sure you have the forms pop up property set to true.  Otherwise the form will be hidden when you hide access.  Also make sure you call application.Quit in the close event of the form. You'll want to make this the startup form of your database.  In case you don't know how, click tools, startup, and select the form name from the Display Form dropdown.  Note that the startup form can be bypassed by holding shift down when you start access, but you can disable that ability by selecting Use Access Special Keys(in acc2000, forget exactly what it's called in 97 but it's in the advanced portion of startup properties).  What a bunch of rambling!

curtn:  Welcome to EE.

You don't have to go through all that code writing and making API calls to do what I think you want to do.  You just want to keep a user under program control.

Spruce22 mentioned the Startup option under the Tools menu.  You have almost all the control that you want regarding how an application will appear from there.  You can provide your own Title, Icon, Custom Menu Bar, Custom Shortcut Menu Bar, and even the Display (startup form).  I prefer not to have a display form and use an AutoExec macro to call a procedure that checks to be sure everything is OK and load the forms.

The most important thing in the Startup option is the ability to customize what portion of Access you leave available to the user (or none).  The options are:

Allow Full Menus
Allow Default Shortcut Menus
Allow Viewing Code After Errors
Allow Built-in Toolbars
Allow Toolbar/Menu Changes
Display Database Window
Display Status Bar
Use Access Special Keys

We only check on Display Status Bar.  Everything else is off.

Regarding turning off the shift key so that the application starts without interuption - turning off Use Access Special Keys is not the answer.  There is code to make this change from a setup DB.  If you feel that you need it, I can give you a copy.

There was quite a bit of discussion about how to turn off the Min, Max, and Close buttons last Fall.  I will have to go back into my archives to find the answer, if you really feel that you want to do it.  I see no reason to do this.  I don't care if the app is minimized or not (I set the opening as Exclusive so the user cannot open two copies at the same time.) and I trap the Close button so that I can do a proper shutdown.

There are a few other customization tricks you can do by clicking the Options item under the Tools menu.  Exclusive is one of those options.

If you elaborate more on exactly what you want to do and why, I can provide you with more details.  BTW, I write commercial Access applications and user interface and security are my hot buttons.

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

One simple line of code to put in your startup screen.. be sure to have a database with a button that does the opposite because there's always the possibility of a user pushing reset before you have turned the window back on.

CommandBars.Item(32).Enabled = False

deletes the MenuBar, closing the last form available also closes MS Access

Be sure to set it back to enabled when you close the main form!!!

Another way to hide the access-window is much simpler. Just use a form that has it's properties set as follows:

borderstyle         = None
Min Max Buttons = None
Closebutton        = No
Autoresize          = Yes
Autocenter          = Yes

then make sure the form is big enough to cover the entire screen

This is a safer way, the close button of the pop-up form can be linked to closing Access  

(using Commandbars.Menubar. Item(#) I think....)


It is customary in the Access Topic area to post answers as 'Comments,' instead of proposing them as 'Answers.'  This prevents the question from being locked, encouraging more robust exchanges, and avoids making the person who asked the question reject one answer so that they can accept a different one.  

Would you please convert your 'Answer' to a 'Comment?'

curtn:  I found a couple of previous questions which might give you more information about removing the title bar et all.  I could have repeated the information here but there is a discussion involved which you might want to read, since we really aren't sure why you want to do this.  will cost you 5 points to read.  is free since the poster deleted the question after the comments were posted.

Of course, I'm still waiting for more information before I write a substantial bit of information that you might not need.

curtnAuthor Commented:
The answer provided simply said "Text below", with no other explanation.  His answer should have been a comment it seems.  Was he trying to poach points from somebody with the correct answer?
curtnAuthor Commented:
Awesome!  I have been looking for this type of solution for a ongoing problem.  I tried it, and it worked flawlessly.  Thanks alot!  
You have to click on the "Text below" to actually see the answer.  For PAQ's the thread is blocked until you pay the few points (10% of the original points for the question) to see the thread and the answer.  I still recommend going back to the first URL reference and reading the thread.  It is very informative about the whole process.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.