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?
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?
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.
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.
Thanks for the reply ItsMe.
How do I do what you are saying?
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.
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?
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.
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]"