Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Posts
    1

    Unanswered: hide all toolbars

    I am having a total mind blank on this - I want to hide all menus for the interface (including the built in menus) so that the user will use nav buttons as they appear on my forms.

    How can I do this? I have tried de-selecting them in the "Customize" right-mouse click menu, but the "Menu Bar" toolbar cannot be removed this way. I also looked in the macro section to see if I could "hide" toolbars / menus in the autoexec macro, but no dice...

    Any help would be great!

    Thanks...

  2. #2
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Found on the web.

    ******READ IT CAREFULLY******AT YOUR OWN RISK*******
    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
    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

    Enjoy
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  3. #3
    Join Date
    Sep 2003
    Location
    Nevada
    Posts
    8

    This also works

    I found this version to be safer and works great:

    ' put all this in the declare section of a module
    ' (the function part will ' automatically configure itself)
    Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long


    Function fSetAccessWindow(nCmdShow As Long)
    '************ Code Start **********
    ' This code was originally written by Dev Ashish.
    ' It is not to be altered or distributed,
    ' except as part of an application.
    ' You are free to use it in any application,
    ' provided the copyright notice is left unchanged.
    '
    ' Code Courtesy of
    ' Dev Ashish

    'Usage Examples
    'Maximize window:
    ' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
    'Minimize window:
    ' ?fSetAccessWindow(SW_SHOWMINIMIZED)
    'Hide window:
    ' ?fSetAccessWindow(SW_HIDE)
    'Normal window:
    ' ?fSetAccessWindow(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
    fSetAccessWindow = (loX <> 0)
    End Function
    ===========================

    Put the following in the Form Open Event:
    ==============================
    Private Sub Form_Open(Cancel As Integer)
    fSetAccessWindow (SW_SHOWMINIMIZED)
    DoCmd.RunCommand acCmdSizeToFitForm
    End Sub
    ==============================

    The only drawback I can find with this version is you loose the ability to use Right Click shortcut feature.

  4. #4
    Join Date
    Feb 2004
    Posts
    4

    Re: This also works

    Originally posted by realbombadil
    I found this version to be safer and works great:

    ' put all this in the declare section of a module
    ' (the function part will ' automatically configure itself)
    Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long


    Function fSetAccessWindow(nCmdShow As Long)
    '************ Code Start **********
    ' This code was originally written by Dev Ashish.
    ' It is not to be altered or distributed,
    ' except as part of an application.
    ' You are free to use it in any application,
    ' provided the copyright notice is left unchanged.
    '
    ' Code Courtesy of
    ' Dev Ashish

    'Usage Examples
    'Maximize window:
    ' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
    'Minimize window:
    ' ?fSetAccessWindow(SW_SHOWMINIMIZED)
    'Hide window:
    ' ?fSetAccessWindow(SW_HIDE)
    'Normal window:
    ' ?fSetAccessWindow(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
    fSetAccessWindow = (loX <> 0)
    End Function
    ===========================

    Put the following in the Form Open Event:
    ==============================
    Private Sub Form_Open(Cancel As Integer)
    fSetAccessWindow (SW_SHOWMINIMIZED)
    DoCmd.RunCommand acCmdSizeToFitForm
    End Sub
    ==============================

    The only drawback I can find with this version is you loose the ability to use Right Click shortcut feature.

    I have tried this but get an error when saving the form where I entered the open event. The error states "the macro named 'Private Sub Form_Open(Cancel As Integer) fSetAccessWindow (SW_SHOWMINIMIZED)DoCmd.' could not be found.

    any ideas on what i am doing wrong?

    thanks

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8

    A EASY WAY

    Put

    =1 in the Menu Bar Properties

    Of the Form

    Then maunal close the all tool bar

    run the Form everything gone

    even the FILE EDIT ......
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  6. #6
    Join Date
    Feb 2004
    Posts
    4

    Re: A EASY WAY

    Originally posted by myle
    Put

    =1 in the Menu Bar Properties

    Of the Form

    Then maunal close the all tool bar

    run the Form everything gone

    even the FILE EDIT ......
    Thanks but unfortunately that doesn't work when multiple users are involved. It only works on the machine that the changes were made on.

    Thanks for the reply though.

  7. #7
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8

    Works For Me

    I can have up to 15 User using the database at one time

    its for a telmarking System I wrote



    I spit the DataBase

    Having Screens as one MDE file

    and the Data in another MDB file

    in the screens All Table are LINK to the Data MDB file
    ( The tables are link by \\servername\MSdata$ so the user don't see it in the my computer icon)

    the Screens are on each user computer
    (this keep the network traffic Down to min)

    each time a user start has computer I have a script that copy the screens
    to the user hard Drive...

    and use =1 in in all my form
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Look up AllowBuiltinToolbars and its examples, also AllowFullMenus and related articles

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •