Results 1 to 7 of 7
  1. #1
    LadyMarmalade is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    9

    "Return to Main Menu" button

    Greetings,
    My access VBA project has several forms. When it's used, it will be used in the runtime environment as a .accdr
    This means they can't access the Navigation panel with all the form names.
    Now my issue is that if the user closes all the forms, they have no way of reopening the main menu.
    I have one of two options ( I think)


    1)I could assign a macro to a keyboard shortcut which opens the main menu again, but I'd need some way of informing them (i.e. a message box).
    The logic process would be If number of open forms = 0 Then MsgBox("You have closed all windows. Press Ctrl + J to open the main menu again
    2)I could have a tiny form hover in the corner of the screen with a 'Open Main Menu' button appear.
    The issue with this is that THAT FORM DEMANDS ALL YOUR ATTENTION PLEBIANS i.e. when that form is active, nothing else can be clicked, which does not work with my project at all.


    Are there any ways of implementing these?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You can use the form's Popup, Modal and BorderStyle properties to do this.

    Set Popup = Yes, Modal = Yes and Border Style = Dialog, and your users must close the form before they can continue.

    One other thing you could do is hide the main menu, instead of closing it, and then unhide it when the other form closes (On Close event).

    John

  3. #3
    kagoodwin13 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Feb 2012
    Posts
    181
    Quote Originally Posted by LadyMarmalade View Post
    Greetings,
    My access VBA project has several forms. When it's used, it will be used in the runtime environment as a .accdr
    This means they can't access the Navigation panel with all the form names.
    Now my issue is that if the user closes all the forms, they have no way of reopening the main menu.
    I have one of two options ( I think)
    1)I could assign a macro to a keyboard shortcut which opens the main menu again, but I'd need some way of informing them (i.e. a message box).
    The logic process would be If number of open forms = 0 Then MsgBox("You have closed all windows. Press Ctrl + J to open the main menu again
    2)I could have a tiny form hover in the corner of the screen with a 'Open Main Menu' button appear.
    The issue with this is that THAT FORM DEMANDS ALL YOUR ATTENTION PLEBIANS i.e. when that form is active, nothing else can be clicked, which does not work with my project at all.


    Are there any ways of implementing these?
    I think you might be over-thinking your solution.

    For starters, don't give users access to the Navigation Pane. This poses a huge security risk - not only can they see the forms, but they can also get access to the raw data tables (which they might change/delete without realizing it is a permanent global change). When you make your runtime version, be sure to disable the Navigation Pane. I would also hide the data tables and queries, just as an added obscurity measure.

    Instead, let your users click through forms and reports, like a custom piece of software.

    With my forms, I have the main form open on startup. When the database opens, it opens the main form. The main form is usually a "switchboard" which has macro buttons to open other forms.

    All subsequent forms open on top of the main form. Each form has a "Close" macro button to go back to the previous form, except for the main form, which can't be closed. It also helps to keep the object-name tabs visible at the top, just in case the users want to navigate around that way.

    In summary, 1. disable the navigation pane, 2. have your main form open on startup, and 3. put close buttons on all forms except for the main form.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I also disable the X close button on each form so users must use the custom button.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    LadyMarmalade is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    9
    Quote Originally Posted by kagoodwin13 View Post
    I think you might be over-thinking your solution.

    For starters, don't give users access to the Navigation Pane. This poses a huge security risk - not only can they see the forms, but they can also get access to the raw data tables (which they might change/delete without realizing it is a permanent global change). When you make your runtime version, be sure to disable the Navigation Pane. I would also hide the data tables and queries, just as an added obscurity measure.

    Instead, let your users click through forms and reports, like a custom piece of software.

    With my forms, I have the main form open on startup. When the database opens, it opens the main form. The main form is usually a "switchboard" which has macro buttons to open other forms.

    All subsequent forms open on top of the main form. Each form has a "Close" macro button to go back to the previous form, except for the main form, which can't be closed. It also helps to keep the object-name tabs visible at the top, just in case the users want to navigate around that way.

    In summary, 1. disable the navigation pane, 2. have your main form open on startup, and 3. put close buttons on all forms except for the main form.
    Ah, I do have the navigation pane disabled, queries/tables hidden etc. and the main form opening on startup. I just hadn't considered having my main form uncloseable.
    Hmm, is there any way to password protect a certain macro?
    The users need to be able to add/delete books, but I can at least have it password protected such that they have to request access first...

  6. #6
    kagoodwin13 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Feb 2012
    Posts
    181
    Quote Originally Posted by LadyMarmalade View Post
    Ah, I do have the navigation pane disabled, queries/tables hidden etc. and the main form opening on startup. I just hadn't considered having my main form uncloseable.
    Hmm, is there any way to password protect a certain macro?
    The users need to be able to add/delete books, but I can at least have it password protected such that they have to request access first...
    You shouldn't need to password protect a "Close Form" macro. You can have the button run a macro in Access, which has a pre-programmed Close Form command, or use a VBA command (DoCmd.Close) with proper error trapping to prevent exposing the macro.

    Tell us more about the process you want your users to complete. I'm not sure what you mean by "add/delete books." You can develop a form to control the editing of all the data in the database.

  7. #7
    LadyMarmalade is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    9
    Quote Originally Posted by kagoodwin13 View Post
    You shouldn't need to password protect a "Close Form" macro. You can have the button run a macro in Access, which has a pre-programmed Close Form command, or use a VBA command (DoCmd.Close) with proper error trapping to prevent exposing the macro.

    Tell us more about the process you want your users to complete. I'm not sure what you mean by "add/delete books." You can develop a form to control the editing of all the data in the database.
    I've solved the problem now.
    The database is just designed to show people in the workplace where various books are stored, and when someone's taken a book, who that someone is.

    Basically, I don't want to make the add/delete books process greatly difficult - it's not a greatly sensitive database, and people won't often be using the add/delete books option.

    On the main menu are several options; withdraw a book, return a book, view all books, view available books, view books on loan, view map of locations and add/delete books.
    Withdraw/Return/Map all cause forms to popup.

    Viewing books causes respective queries or tables to open in Read Only mode.

    Add/Delete books causes the original books table to open in an editable mode.

    All I want is to be able to password protect the add/delete books button; I've managed to do it now though, so thanks for the help!

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

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  2. Replies: 3
    Last Post: 06-29-2012, 08:54 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  5. Replies: 13
    Last Post: 07-27-2011, 12:38 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