Results 1 to 7 of 7
  1. #1
    jmccon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2015
    Posts
    12

    Adding a Menu in Access 2007

    Anyone know how to add a Menu in Access 2007 where I can click on menu options and it takes me to whatever form or report I clicked on in the menu?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    My preference is to use a form that launches at startup to provide users a 'menu' of sorts. In this case, code behind the form opens the appropriate form or report. I believe you can add custom buttons to the Ribbon that execute macros, too.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    Yes follow ItsMe's advice; create a form and put command buttons on it to be your menu. I strongly recommend avoiding the Switchboard feature set - though well intended is over engineered and not ideal to work with.

  4. #4
    jmccon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2015
    Posts
    12
    Thanks for the reply ItsMe.

    How do I do what you are saying?

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I create form's using Design View. I avoid using the Wizard and or Layout View for creating forms. The Wizard is good for many things. I just do not see many advantages to using the Wizard to create forms.

    There are controls that can be added to a form while in design view. They are located within the Ribbon, under the Design Tab/Group. One control is the Command Button. You can select the Command Button tool from the Ribbon and place a new Command Button on your form. If you use the Wizard to assist you in creating a new command button, the Wizard will create a Macro that will, in turn, perform some sort of action for the user. Alternatively, you can build code behind the button that will execute when the User clicks the Button. I prefer to use code and there are plenty of examples of code to get you started.

  6. #6
    jmccon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2015
    Posts
    12
    Could you point me in the direction of some code I could use for the command buttons to open other forms?

    And could you point me in the direction of code for the macro to open the initial form on load, or do I need any code for this?

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    The idea of a Macro is you do not use any code. You read a sentence, make a selection, and save your selection. You can create and name a macro or you can use the wizard for a command button to have Access embed the macro in a way it will be permanently associated with the command button.

    You can create a button and place code behind the button. To do this, you need to be aware of the Properties Sheet. Here is an illustration of the property sheet. When you create a new control on your form, it will have focus and be selected. If you click somewhere else, another control or object will have the focus. The property sheet will show properties for the control that is selected, only. You can click on a control or you can use the pulldown in the property sheet to make the selection.

    Click image for larger version. 

Name:	PropertyWindow.jpg 
Views:	14 
Size:	66.0 KB 
ID:	22353

    In the property sheet there is a tab named 'Events'. Select this tab and locate the On Click event. Next to it is an empty field and an ellipses(...). Click the elipsess and select Code Builder from the dialog box. CLick OK to open the Visual Basic Editor. A new procedure will be created. At least, the beginning and the end of your new procedure will be created. The cursor will automatically be placed in the middle. Your code will go in the middle, where the cursor is.

    All you need to do is replace the text in Red with the name of your form.
    Code:
    DoCmd.OpenForm "[FormName]"

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

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2014, 11:27 PM
  2. Replies: 6
    Last Post: 10-26-2012, 09:28 AM
  3. Replies: 0
    Last Post: 05-10-2012, 01:25 PM
  4. Replies: 0
    Last Post: 10-25-2010, 09:23 AM
  5. Access 2007 menu bar, toolbar...
    By truthseeker170 in forum Security
    Replies: 1
    Last Post: 07-15-2009, 01:45 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