Results 1 to 5 of 5
  1. #1
    jaarons is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    22

    Button For "Edit Mode"


    Hi all,

    Another day, another question. I have my database open to a splash screen and then a main menu. I would like the database to open without the ribbon and without the navigation buttons and without any right click functionality. BUT I want a hidden button on my main menu form (transparent, etc) that has code that will bring it all back.

    I've found the options for "current database" and have managed to close the navigation pane, some of the ribbon and the right click functionality. Can I hide the ribbon altogether? Does my splash screen form need an "onLoad" macro/code to do this? And what code do I put on the button to bring it all back (to what I call "Edit Mode")?

    Thanks for your help!

  2. #2
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    I'm not sure if there is a better way to hide the shortcut menu and navigation buttons for the forms. Of the top of my head, one way you can do to store 2 variables in a module that will indicate if those features are enabled or not.

    In a module, e.g. basFlags, declare 2 variables.
    Code:
    Public gEnableShortcutMenu as Boolean
    Public gNavigationButtons as Boolean
    In the Load event of the splash screen, use the following code.
    Code:
    Private Sub Form_Load()
        'Hide the ribbon
        DoCmd.ShowToolbar "Ribbon", acToolbarNo
    
        'Set the flags
        gEnableShortcutMenu = False
        gNavigationButtons = False
    End Sub
    Then, in the Click event of your Edit button, use the following code.
    Code:
    Private Sub CmdEdit_Click()
        DoCmd.ShowToolbar "Ribbon", acToolbarYes
        gEnableShortcutMenu = True
        gEnableNavigationButtons = True
    
        'This affects the current form
        Me.ShortcutMenu = gEnableShortcutMenu
        Me.NavigationButtons = gEnableNavigationButtons
    End Sub
    In the Load event of all other forms, use the following code.
    Code:
    Private Sub Form_Load()
        Me.ShortcutMenu = gEnableShortcutMenu
        Me.NavigationButtons = gEnableNavigationButtons
    End Sub

  3. #3
    jaarons is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    22
    An extremely belated thanks for this! I've been away from the project for a few weeks, and I finally got this going. Your code worked a charm.

  4. #4
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    You're welcome.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by jaarons View Post

    ...I want a hidden button on my main menu form...
    What I always do for this type of thing is to simply use the OnClick event of a Label in place of a Command Button. It accomplishes the task, and very few users know that a Label can be used in this fashion, much less think about clicking on one. The only caveat is that it has to be an independent Label, i.e. one you've created and placed on the Form, as opposed to one that Access automatically creates and associates with another Control (such as a Textbox) that you place on the Form.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 13
    Last Post: 01-11-2012, 09:44 PM
  3. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  4. Replies: 3
    Last Post: 03-07-2011, 08:37 PM
  5. Creating "Edit Record" link in table column
    By joshearl in forum Forms
    Replies: 1
    Last Post: 12-25-2009, 11:17 AM

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