Results 1 to 14 of 14
  1. #1
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22

    Disable the blue title bar at the top of Access 2000

    How can I disable the blue titlebar at the top of Access 2000 and the controls that are on the blue titlebar?



    Using a single stand alone pc, use will be restricted to only the controls (command button, list-box, combo-box) on the forms of one Access 2000 mdb. I have an exe file that will remove the Windows task bar and a line of code to hide the form menu and the other controls on this level. This leaves only the disabling of the blue titlebar at the top of Access 2000.

    Users will have only the use of the left key on the mouse. A keyboard will be connected to the computer but not accessible by the public.

  2. #2
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    this limits keyboard entry to the keys you allow

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim intCtrlDown As Integer, intAltDown As Integer, intShiftDown As Integer
    intAltDown = (Shift And acAltMask) > 0
    intCtrlDown = (Shift And acCtrlMask) > 0
    If intCtrlDown Then
    If KeyCode = vbKeyF4 Then
    KeyCode = 0
    Else
    Exit Sub
    End If
    End If
    If intAltDown Then
    If KeyCode = vbKeyF4 Then
    KeyCode = 0
    Else
    Exit Sub
    End If
    End If
    End Sub

    opens db without any controls (be carefull!)

    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
    On Error Resume Next
    fActivateControlBox (False)
    Application.RefreshTitleBar
    Application.CommandBars.ActiveMenuBar.Enabled = False
    end sub

    stops form being closed

    Private Sub Close_Form_Click()
    if InputBox("Enter your Password to Continue", "Security Check", vbOKCancel) = "your password here" Then
    DoCmd.Quit
    Else
    End If
    End Sub

    your should also have a way to turn the command bar back on, ' Application.CommandBars.ActiveMenuBar.Enabled = true ' in an autoexec form in an empty db
    run db, startup form on open

    DoCmd.Restore
    Application.CommandBars.ActiveMenuBar.Enabled = True
    Application.RefreshTitleBar
    fActivateControlBox (True)
    DoCmd.RunCommand acCmdExit

  3. #3
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    Tried "Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)" but I can still left click on the blue title bar and the controls. Probably only works with the keyboard but I tried it with the left mouse button.


    Trying with all controls turned off. During form open, fActivateControlBox (False) errored with the Microsoft Visual Basic msg box of "Compile error" Sub or Function not defined"

  4. #4
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    sorry about that, the code below needs to go into a module for it to work

    you can also use to turn on off the control, close, min and max buttons

    Public Function fActivateControlBox(Enable As Boolean)
    Dim CurStyle As Long
    Dim hWnd As Long
    hWnd = Access.hWndAccessApp
    CurStyle = GetWindowLong(hWnd, GWL_STYLE)
    If Enable Then
    If Not (CurStyle And WS_SYSMENU) Then
    CurStyle = CurStyle Or WS_SYSMENU
    End If
    Else
    If (CurStyle And WS_SYSMENU) = WS_SYSMENU Then
    CurStyle = CurStyle - WS_SYSMENU
    End If
    End If
    Call SetWindowLong(hWnd, GWL_STYLE, CurStyle)
    Call DrawMenuBar(hWnd)
    End Function
    Public Function fActivateCloseBox(Enable As Boolean)
    Dim hMenu As Long
    Dim hWnd As Long
    hWnd = Access.hWndAccessApp

    If Enable Then
    Call GetSystemMenu(hWnd, True)
    Else
    hMenu = GetSystemMenu(hWnd, False)
    If hMenu Then
    Call DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
    End If
    End If
    Call DrawMenuBar(hWnd)

    End Function
    Public Function fActivateMaximizeBox(Enable As Boolean)
    Dim CurStyle As Long
    Dim hWnd As Long
    hWnd = Access.hWndAccessApp
    CurStyle = GetWindowLong(hWnd, GWL_STYLE)
    If Enable Then
    If Not (CurStyle And WS_MAXIMIZEBOX) Then
    CurStyle = CurStyle Or WS_MAXIMIZEBOX
    End If
    Else
    If (CurStyle And WS_MAXIMIZEBOX) = WS_MAXIMIZEBOX Then
    CurStyle = CurStyle - WS_MAXIMIZEBOX
    End If
    End If
    Call SetWindowLong(hWnd, GWL_STYLE, CurStyle)
    Call DrawMenuBar(hWnd)
    End Function
    Public Function fActivateMinimizeBox(Enable As Boolean)
    Dim CurStyle As Long
    Dim hWnd As Long
    hWnd = Access.hWndAccessApp
    CurStyle = GetWindowLong(hWnd, GWL_STYLE)
    If Enable Then
    If Not (CurStyle And WS_MINIMIZEBOX) Then
    CurStyle = CurStyle Or WS_MINIMIZEBOX
    End If
    Else
    If (CurStyle And WS_MINIMIZEBOX) = WS_MINIMIZEBOX Then
    CurStyle = CurStyle - WS_MINIMIZEBOX
    End If
    End If
    Call SetWindowLong(hWnd, GWL_STYLE, CurStyle)
    Call DrawMenuBar(hWnd)
    End Function

  5. #5
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    I used CommandBars.ActiveMenuBar.Enabled = False to hide the from menu and form controls (min, restore and close).

    During run, at CurStyle = GetWindowLong(hWnd, GWL_STYLE)..........GetWindowLong is highlighted and the Microsoft Visual Basic msg box displays "Compile error" Sub or Function not defined"

    I see several Call statements but no form modules. The three factive modules are way beyond my code level.

  6. #6
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    sorry again about that, my cut and paste was a bit off.
    add this to the top of the module and it should be ok.

    the two parts together make up the complete module.

    Option Compare Database
    Private Declare Function GetWindowLong Lib "User32" _
    Alias "GetWindowLongA" _
    (ByVal hWnd As Long, _
    ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "User32" _
    Alias "SetWindowLongA" _
    (ByVal hWnd As Long, _
    ByVal nIndex As Long, _
    ByVal dwNewLong As Long) As Long
    Private Declare Function GetSystemMenu _
    Lib "User32" _
    (ByVal hWnd As Long, _
    ByVal bRevert As Long) As Long
    Private Declare Function DrawMenuBar _
    Lib "User32" _
    (ByVal hWnd As Long) As Long

    Private Declare Function DeleteMenu _
    Lib "User32" _
    (ByVal hMenu As Long, _
    ByVal nPosition As Long, _
    ByVal wFlags As Long) As Long

    Private Const MF_BYCOMMAND = &H0&
    Private Const SC_CLOSE = &HF060
    Private Const WS_SYSMENU = &H80000
    Private Const WS_MAXIMIZEBOX = &H10000
    Private Const WS_MINIMIZEBOX = &H20000
    Private Const GWL_STYLE = (-16)

  7. #7
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    ps the module was copied from someware long ago, the code level is above me too, but I can still reference it
    let me know how you get on.

  8. #8
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    Getting closer for the bluebar title controls in the upper left and right corners are not visible.

    Still needed is disabling the blue title bar itself. Using the left mouse key, I can press the left key down and move the Access frame around on the screen. If I double click and the ACCESS frame reduces slightly in size but double click and the Access frame is maximized

  9. #9
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    Hi again,
    seems you can't get rid of the application titla bar, BUT you can hide it!

    I found this link

    http://www.experts-exchange.com/Data..._20652400.html

    good luck.

  10. #10
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    An Early Morning to you Trevor.

    Disabling the blue title bar is good enough. Removal is not necessary

    I prefer not to go the experts-change route but I will keep it as a last resort. Dont want to mess with sign up, payment then apply for refund during the 30 day free trial period.

  11. #11
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    Yep I got that too, It's a strang site, sometimes it works ok.
    try this

    Enter ' remove title bar from access with vba ' into a browser search, I use bing...

    find the result - Hide Title bar: title, hide, bar - Experts Exchange

    click on that

    this should then take you to the site without login

    and should say - Enjoy your unlocked premium solution

  12. #12
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    If your goal is to just keep your users from accessing any of the functions on the menu bars, you can use the popup and modal properties of your form. If both of these are set to "Yes", then as long as the form is open, users cannot access any of the menu functions (or any other forms), even though the menus are visible.

    MS Access Help gives more details.

    HTH

    John

  13. #13
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    "popup" and "modal" properties to "yes" removed the blue title bar.

    On the form that the mdb opens to, is a command buttom to open another form. Clicking on that button opens the form but it is hidden behind the form with the command button.

  14. #14
    chuck555 is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2014
    Posts
    22
    My original post is solved. Thanks much all.

    A bit of testing shows the the hidden form problem is related to the property changes to popup and modal. Will try some code with the command button module to change form properties. If I can not resolve, make a new post with a new problem to resolve.

    Any how, I am closer now than before posting this thread

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-17-2012, 01:07 AM
  2. Replies: 2
    Last Post: 04-28-2011, 07:30 PM
  3. Replies: 4
    Last Post: 01-02-2011, 08:09 PM
  4. Variable Report Title in Access 2010
    By Titan078 in forum Reports
    Replies: 4
    Last Post: 11-17-2010, 11:22 AM
  5. Replies: 0
    Last Post: 06-14-2009, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums