Controlling display of the Access menu bar and program

P

ProgramDoc

When I run my databases I would like to have the screen display only the
forms in my database, not parts of the MS Access program or engine such as
the menu bar at the top ("Home", "Create", etc.) and the "Quick Access
Toolbar". Is there any way to configure the MS Access program so it does not
display these components. When they appear it looks like the database is
still being developed and is not a finished product. I have searched through
all the literature, but can't find a solution.
 
A

Albert D. Kallal

If you in the code editor, and type in hide ribbon, I think it is the 2nd
hit in the search.

You can hide most of the interface.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

There is a 2007 version in the above...and it only shows the ribbon when
viewing reports....
 
B

blake7

Hi
With your database open click on the office button (top left) and go to
"Access Options" button near the bottom of the drop down menu, in here you
can configure how you want the database to open and what is to be displayed.
Regards
Tony
 
P

ProgramDoc

Thank you Blake7. I have reviewed the "Access Options" several times and it
will not let you set Access to hide the menu bar or the "Quick Access
Toolbar". It only works for the "Ribbon".
 
P

ProgramDoc

Hi Albert,
Thank you for your comments. I want to hide all of the Access interface and
let my code control the program. When you hide the Ribbon, you still see the
menu bar and quick access menu. I just want a black screen that displays my
forms at runtime. This is obviously more difficult that I anticipated.
Isn't there a simple set of switches, beyond those in the options menus, that
lets you hide or display various interface elements beyond the Ribbon?
 
K

Keven Denen

Hi Albert,
Thank you for your comments.  I want to hide all of the Access interface and
let my code control the program.  When you hide the Ribbon, you still see the
menu bar and quick access menu.  I just want a black screen that displays my
forms at runtime.  This is obviously more difficult that I anticipated. 
Isn't there a simple set of switches, beyond those in the options menus, that
lets you hide or display various interface elements beyond the Ribbon?









- Show quoted text -

There are several methods for doing this. One of the slickest I've
seen is listed below. Unfortunately, I don't remember where I got this
code from, so I can't give credit where it's due.

Post the code below into a new module in your database.

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

Private Declare Function apiShowWindow Lib "user32" Alias
"ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Function DoAccessWindow(nCmdShow As Long)
' This function can minimize Access behind the scenes.

'Usage Examples
'Maximize window:
' ?DoAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?DoAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?DoAccessWindow(SW_HIDE)
'Normal window:
' ?DoAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loform As Form
On Error Resume Next
Set loform = Screen.ActiveForm
If Err <> 0 Then 'no Activeform
If nCmdShow = SW_HIDE Then
MsgBox "Cannot hide Access unless a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True
Then
MsgBox "Cannot minimize Access with " &
(loform.Caption + " ") & "form on screen"
ElseIf nCmdShow = SW_HIDE And loform.PopUp <> True Then
MsgBox "Cannot hide Access with " & (loform.Caption +
" ") & "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
End If
DoAccessWindow = (loX <> 0)
End Function

Now you can use the DoAccessWindow() function to mess with the Access
window. You may want to play around with the hide option, as it
totally hides the Access interface. A word of warning, any form you
want to display must be Popup and Modal in order to be visible.

So for instance, on the Form_Open event of whatever Form you have set
to load at startup, you could use the code DoAccessWindow(0) to hide
Access's interface, then on the Form_Close event, you would use
DoAccessWindow(1) to show the interface again.

Keven Denen
 
J

James A. Fortune

Keven said:
There are several methods for doing this. One of the slickest I've
seen is listed below. Unfortunately, I don't remember where I got this
code from, so I can't give credit where it's due.

Post the code below into a new module in your database.

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

Private Declare Function apiShowWindow Lib "user32" Alias
"ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Function DoAccessWindow(nCmdShow As Long)
' This function can minimize Access behind the scenes.

'Usage Examples
'Maximize window:
' ?DoAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?DoAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?DoAccessWindow(SW_HIDE)
'Normal window:
' ?DoAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loform As Form
On Error Resume Next
Set loform = Screen.ActiveForm
If Err <> 0 Then 'no Activeform
If nCmdShow = SW_HIDE Then
MsgBox "Cannot hide Access unless a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True
Then
MsgBox "Cannot minimize Access with " &
(loform.Caption + " ") & "form on screen"
ElseIf nCmdShow = SW_HIDE And loform.PopUp <> True Then
MsgBox "Cannot hide Access with " & (loform.Caption +
" ") & "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
End If
DoAccessWindow = (loX <> 0)
End Function

Now you can use the DoAccessWindow() function to mess with the Access
window. You may want to play around with the hide option, as it
totally hides the Access interface. A word of warning, any form you
want to display must be Popup and Modal in order to be visible.

So for instance, on the Form_Open event of whatever Form you have set
to load at startup, you could use the code DoAccessWindow(0) to hide
Access's interface, then on the Form_Close event, you would use
DoAccessWindow(1) to show the interface again.

Keven Denen

C.f:

http://groups.google.com/group/comp.databases.ms-access/msg/51fbd03c5ce3f64c

The code appears to have originated from Dev Ashish.

James A. Fortune
(e-mail address removed)
 
A

Albert D. Kallal

ProgramDoc said:
Hi Albert,
Thank you for your comments. I want to hide all of the Access interface
and
let my code control the program. When you hide the Ribbon, you still see
the
menu bar and quick access menu. I just want a black screen that displays
my
forms at runtime. This is obviously more difficult that I anticipated.
Isn't there a simple set of switches, beyond those in the options menus,
that
lets you hide or display various interface elements beyond the Ribbon?

Yes, just use:

DoCmd.ShowToolbar "Ribbon", acToolbarNo

The above will hide all of the qat also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top