Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727

    Hiding ribbon window

    I found this cool docmd to hide the ribbon and I know about how you can make custom ribbons and all that. The docmd I found is this:

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    However, I was wondering if there was something similar to hide that whole window that is behind the form itself? So all the user sees is the pop up/modal form. If this is not possible then is there a way to at least hide the status bar that shows Form View and Num Lock on the bottom of the screen? I am looking for ways to make it look as simple as possible cosmetically and that big window behind the form looks unnecessary to me.

  2. #2
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Found this code:

    Option Compare Database
    Option Explicit

    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 fSetAccessWindow(nCmdShow As Long)

    Dim loX As Long
    Dim loForm As Form
    On Error Resume Next
    Set loForm = Screen.ActiveForm

    If Err <> 0 Then
    loX = apiShowWindow(hWndAccessApp, nCmdShow)
    Err.Clear
    End If

    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
    fSetAccessWindow = (loX <> 0)
    End Function

    You add that in a new module. Then you add this to a On Load event of a form:

    Call fSetAccessWindow(0)

    It works pretty good except the fact that there is no item of Access on the taskbar to either minimize or bring the window back up in view. Is there a way to do that? If you close the window without quitting the app, it will run forever until you shut down your computer because the back ground Access window is only hidden and can't be closed without quitting the whole database. In other words, I have some quit buttons in forms that will quit the database and that way works. However if you close the window by right clicking the top border of the window, it will close the form but not the Access Window. I even tried to end it wth Ctrl, Alt, and Delete but its also not showing up in there which is weird. Can someone figure this out? I really would like a way to add an Access taskbar item so if I minimize my form I can click on it in the taskbar to bring it back.

  3. #3
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    I remember you asking about menus a while back in another post, my reply would be the same.

  4. #4
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    This is actually more about hiding the access window that resides behind the pop up/modal form. Did you check out the functions above? It works. Just needs some adjustments to fix the minimizing of the form. It doesn't show up on the taskbar. Also, I found that when I try to open a report, it doesn't show up and because its in modal, it will then not let me click on my split form that is supposed to stay open with the report showing over it. So then I can't close the database because the report has the focus which is no where in site.

    Does anyone know how to fix this issue? This hidding the background Access window is awesome because it makes the app look and feel like a real application without that stupid window behind everything. I just need to get some things fixed with this feature.

  5. #5
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    it's all related to your modal, menu hiding issue, I can't follow your posts any more as you can't keep them together.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have been using a custom function combined with importing old school MDB custom menus to lock down my accdb files.

    The following are some lines of code that can work independently or collectively
    Code:
    '
    'ChangeProperty "AllowFullMenus", DB_BOOLEAN, False 'Access Full Menus.
    'ChangeProperty "AllowSpecialKeys", DB_BOOLEAN, False 'F11, ALT F11, etc.
    'ChangeProperty "AllowBypassKey", DB_BOOLEAN, False 'Shift Key Override on loading.
    'ChangeProperty "AllowShortcutMenus", DB_BOOLEAN, False 'Access Shortcut Menus. May be too severe.
    'ChangeProperty "AllowBuiltInToolbars", DB_BOOLEAN, False 'Toolbars.
    'ChangeProperty "AllowToolbarChanges", DB_BOOLEAN, False 'Prevent Changes.
    'ChangeProperty "AllowBreakIntoCode", DB_BOOLEAN, False 'Code access.
    'ChangeProperty "AllowFullMenus", DB_BOOLEAN, False 'Access Full Menus.
    They call a custom UDF found in the following link. I have used this thread as reference almost from day 1.
    https://www.accessforums.net/securit...html#post24088

  7. #7
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Sorry trevor40. Thanks for all the help you provided. I learned a lot from you.

  8. #8
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    ItsMe,

    where do I apply that code? Also what exactly does all of it do? I have an idea for some of them but not all. What does each line do and where do I place the code? Thanks.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    They do different things. If you go to MSDN.com and search their website for the different property names you will get more info.

    Searching for "AllowBreakIntoCode" gave me this link that provides good info.

    http://stackoverflow.com/questions/1...nged-using-vba


    You can also try them out and see. Some properties need a restart to take affect. The trick is not to lock yourself out and always allow yourself a backdoor to get in. Or, at least, run the code on a copy FE that you then distribute.

  10. #10
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Yeah I've locked myself out before. Right now I lock out a copy and test it then if I need to make changes I have to trash that file and create another copy of the unlocked master file and do changes then lock it up and test again. I have to keep repeating this process. Do you have a procedure that can do a password to maybe enable the shift key or something because right now I have it disabled. How does yours work?

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Use code to change the settings on the DB when the correct User ID and password is entered. If your DB needs to be locked down you should probably be using an executable. Any time you do an edit you will have to publish as an executable. Every time you edit an executable you will need edit the master and republish the executable.

  12. #12
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Why not just set your opening form to Pop-up/Modal?

  13. #13
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Tell me more about executables. How do you do this?

  14. #14
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Do a search. Basically it deletes the VBA and utilizes the runtime code that results from compile time.

  15. #15
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Will the user still be able to add records to the backend table?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-23-2013, 08:11 AM
  2. Hiding the Ribbon in a dB Application
    By jtvcs in forum Access
    Replies: 0
    Last Post: 03-26-2011, 09:41 AM
  3. Hiding The Ribbon
    By rashidhussain in forum Forms
    Replies: 1
    Last Post: 03-01-2011, 03:36 AM
  4. Hiding ribbon
    By jgelpi16 in forum Access
    Replies: 3
    Last Post: 12-16-2010, 11:12 AM
  5. hiding forms
    By Halocarbon in forum Access
    Replies: 1
    Last Post: 12-09-2005, 09:51 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