|
|
Step Number 1First, make sure that you have opened Microsoft Access to the window shown. Be sure that the database window is open to the forms window. Step Number 2Create a new form in design view. You should see a window similar to the one below. Be sure that the toolbox is open - you will be using it to design the form. Step Number 3Go ahead and expand the window so that you have a larger work area. Step Number 4Using the rectangle tool, draw a rectangle across the top of the form. This will be a colored title bar for your switchboard form. Step Number 5Now, right-click on the rectangle you drew and choose Properties... from the menu that pops up. Step Number 6The properties dialog box for the rectangle should now pop up. Choose the Border Style drop down box and select the Transparent option. This will get rid of the border around the rectangle. You may put it back later if you wish - it's a design choice, not a function choice. Step Number 7Next, select the Backstyle drop down box and choose the Normal option. This will allow you to fill the rectangle with a color. You may want to experiment with the color used. Step Number 8Now, select the Backcolor item on the Properties dialog box. Doing so will bring up the color menu shown below. From the image below, you can see which color I picked. You should pick one that suits your taste. Remember that this form is the first one that users of your database will see. Step Number 9After you have closed out the color selection dialog box, you should return to the form design window. Step Number 10Choose the Label tool from the toolbox and draw a label as shown in the picture below. You may note that the label is off-center, both horizontally and vertically. There is a reason for this, as you will see shortly. Step Number 11If the properties window is not already open, right-click on the label and select Properties from the popup menu. Once the properties window is open, find the drop down list labeled Font Name and change the font name to Arial Black. Arial Black is a more appropriate font for a title bar, but feel free to experiment with the available fonts if you wish - you might find something that suits you better. Step Number 12Now, change the Font Size to 18 using the drop down list labeled Font Size. Changing the font to a larger size makes the title stand out better and will improve the appearance of the form. Note: If you used a font other than Arial Black, you may need to use a different font size for the display to look appropriate. Step Number 13Now, the title stands out, but it doesn't look as good as it could. We are going to do a little trick to give the text a 3D appearance. Right-click on the label and select Copy from the popup menu. This copies the label to the clipboard and will allow us to create a replica of it without having to draw another one and go through all the extra steps. Step Number 14Next, we will paste a copy of the label on the form. Right click on the form and select Paste from the popup menu. Step Number 15Voila! A copy of the label will appear on somewhere on the form (probably along the bottom edge). If yours comes up in a different location, it doesn't really matter. We will move it soon enough. Step Number 16Now right-click on the label you just created and select the Font/Forecolor. A menu similar to the color dialog box should appear to the right. Select the last item in the bottom row(white). This will change the label's forecolor. Step Number 17We are almost done making the label appear 3D. All we need to do is drag the label that has the white foreground so that it is slighly above and to the left of the label with the black foreground. This vastly improves the look of the text. You might also want to experiment with different foreground colors on the labels for different effects. Step Number 18Next, we want to improve the way the switchboard form appears while it is running. I personally think that the dividing lines are always ugly, and the navigation buttons are useless, since this form doesn't read any data from a table. We will go through the process of fixing these things in the next few steps. Right click on the upper left corner of the form design window (as shown in the figure below) and select properties from the pop-up box .Step Number 19First, let's get rid of the record selectors - they are only useful if your form actually deals with records, which this one does not. Select the Record Selectors option and change it to No. Step Number 20Navigation buttons are also useless(or worse) on a switchboard form. Select the Navigation Buttons option on the form and set it to No. Step Number 21Now, we'll get rid of the dividing lines, since (as I've said before) they are ugly and serve no useful purpose. Select Dividing Lines and change it to No. Step Number 22While we are here, let's set the Auto Center property to true. This will cause the form to be centered in the screen when it loads. Step Number 23If you were to view the form in form view right now, it would look a lot better, but you would probably notice the rather useless scrollbars along the right side of the form. Let's get rid of those as well. Select the Scrollbars item and choose None. Step Number 24After all this effort to make the form look good, we don't want the user resizing it and making it look ugly again. We will change the borderstyle of the form to make it non-resizable. Choose the Borderstyle option in the properties dialog box and select Dialog. Step Number 25Now, the form looks pretty good, but it's painfully obvious that we've forgotten something so far. The form has no useful function! We need to add some choices to this switchboard so that the user can navigate around our database. Create three labels as shown below (you may change font name, font size, and foreground color as you see fit - this is your database, after all). Step Number 26Now, add a command button to the form. The command button wizard should pop up on the screen. This button will open a form in the database, so select Form Operations from the catagories listbox on the left side of the dialog and choose Open Form from the Actions listbox on the right side of the dialog. Click Next. Step Number 27We want this button to open the Recipes form, so select frmRecipes from the listbox. Click Next. Step Number 28We want this button to open the form and show all the records, the user can filter the results for themselves, if they wish to do so. Select Open the form and show all the records. Click Next. Step Number 29Now we can choose either a picture to represent the button, or text. We already have text on the form for this button, so choose a picture. I chose the MS Access Form picture, but you can easily choose a different one if you wish, using either the Browse... button or by clicking the Show all pictures. Step Number 30Finally, we need to assign a meaningful name to this button so that we can refer to it later. Call it cmdRecipesForm. Click Next. Step Number 31Go ahead and add buttons to the Ingredients and Food Catagories forms and position them as shown below. Step Number 32Make sure that your window looks like the one below and then click on the button to show the form in form view. Step Number 33Well, the form looks pretty good for the time being. We'll work on it more later. Go ahead and exit the form. When you are prompted to save, be sure and do so. Step Number 34It would be nice if the switchboard dialog we just created would load when you begin using the database. As it turns out, Access has a fairly straightforward way of doing this. Simply click on the Tools menu and select Startup... Step Number 35The following dialog box should appear on your screen. You can specify your application title and other useful things here. For now, we'll simply set the startup form to be the main switchboard. Step Number 36Go ahead and set the startup form to be frmSwitchboard. Typically, you would not want to display the database window in a normal application, but leave it alone for now. You'll need it for the rest of this tutorial. |