Designing Forms

Introduction:
If we agree that tables are where you will spend time designing the functionality of your database, forms are where you will spend a lot of time, especially in the beginning, to design the look of your database. As a small note, keep in mind that many companies or bosses will not just pay you for being able to create a database, how it looks sometimes count tremendously.

Creating A Form In Design View:
Microsoft Access comes equipped with a lot of features to suit your tastes, but it is up to you to be aesthetically creative.
  1. Open the Music Collection3 database.
  2. From the main menu, click Insert -> Form.
  3. In the New Form dialog, click Design View. In the combo box, choose the tblMusicAlbums table, and click OK. You get a raw form, a toolbox, and the table's field list.
    To perform your design, a form has two rulers, one horizontal on the top of the form, one vertical on the left, to help you be more precise with dimensions. Then you have a toolbox equipped with buttons, edit boxes and other items you can use to give a lot of flexibility to your application. Usually, you will have the toolbar whenever you are working in the Design View. You also have the originating table, the field list, on your screen in case you want to add an item that you didn't include in the beginning. When you don't need any or both of these two items, you can hide them by clicking their buttons on the toolbar.
    There are different ways you can retrieve an item from the list and place it on your form. For example, you can drag one from the list and place it on the form. You can also double-click on the title bar of the field list to select all items, then drag all of them to the list.
  4. Double-click on the field list's title bar to select all items from the list, then click in the blue list and drag everything to the form. At first, you might get something that looks messed up, but that's why you will design and customize it.
  5. Save the form as frmAlbums , then close it.
  6. Now open the frmAlbums1 form in Design View. To manipulate an item on the form, you click on it to select it. To select more that one item, you can click the first one, then you hold down the Shift key and click the other different items that you need. If all the items you want to select are on a certain portion or angle of your form, you can drag/draw an empty rectangle that covers all the items that you want to select. If the items that you want to select are aligned, you place your mouse in the ruler that corresponds to the alignment until it becomes an arrow, then you click. The main area you work on is called the Details area. But a form can be divided in different sections or areas. You can have a Header section where you would write a title or anything you want to keep on top of your form. In the same way, you can have a Footer section to display some data, for example the date and/or time. In Design View, a form has a small square on the intersection of both rulers in the top left area
    This area (normally, it's a button) can be used to access some of the properties of a form.
Form Design:
  1. In Design View click any of the edit boxes. If you place your mouse on different parts of the selected edit box, it gets different shapes. The open hand means you can move the whole item including its label and its edit box. The closed fist with a pointing finger means you will move only the item where the mouse is positioned. The double arrow means you can enlarge or shrink the item where the mouse is pointing. To change the forms size, that is to enlarge or shrink it, you place your mouse on one of the borders until the pointing mouse arrow changes to a solid black line with double arrows, then you can increase (enlarge the table) or decrease (shrink) the size of the table.
  2. Then place you mouse inside the horizontal ruler in dimension 1 1/2 until it becomes a down arrow, then click. That selects all items on the form. Place your mouse on one of the items until you see an open hand, then drag everything to the right until both rulers show a 1/4 dimension.
    Click anywhere in an empty area of the form to deselect the items.
  3. Design your form and move items, play with the mouse for a while until you get something that looks like this, or suit your taste.
    When you are finished, click the Form View button on the toolbar to preview your form. If some items don't appear in the form or you think that the window is too large for the items on the form, on the main menu, click Window -> Size To Fit Form. Save and close the form. Sometimes, there might be so many items on your form that you can't keep them aligned. The best solution in not to delete them but to move some items and accommodate space.
Filling Out A Form:
To fill out a form, you go through different boxes either by typing values, choosing values available, or causing values to be calculated from other values provided. To move from one box to another, you can click with the mouse. To move from one box to the next, you can press the Tab key. To move from one record to another, you use the Navigation buttons at the bottom of the form, these buttons and their edit box behave as those we already saw in the tables designs.
  1. Open the frmAlbums3 form. It might look like the following:
    Press Tab to move through different boxes.
  2. Click the New Record button on the form to enter a new record. Use the Tab key to move from one box to another. For the new Album Title, type Tekit Izi; the Artist is Kassav', the Category is Zouk; it was released in 1992; the label is Sony; the CD album has 10 tracks; you can leave the Comments empty.
  3. While you are moving from one box to another using the Tab key, if the cursor doesn't land to the next box, then you should adjust the order of navigation. You control that from the Tab Order dialog box. Switch to the Design View. Then click View -> Tab Order (you could also right-click in the design view and make your choice.
  4. As we have learned how to move items in a table, move the items appropriately until you get the order you want. Then save the form.
  5. When you have finished, close the form and the database.
Improving Forms Looks
A form is supposed to look good because some people will spent a great of time looking at your forms. Although what is going on behind a form is very important, people might not pay enough attention to your database if your forms are boring in design, take too much space on the screen, don't use enough space on the screen, hide and disappear some time to time.

Different forms are meant to accomplish different purposes. The process you use to create a form is the same, the end result is different. Some dialogs are used as a splash screen while some others are used as intermediary dialogs, some others serve as the basis to register customers. We will keep these in mind as we go along.

A Form In Simple Form:
Some forms are meant to be small, they don't hold too much (unnecessary) data.
  1. Start Microsoft Access and open the Videos4 database.
  2. Open the tblActors table to view, then close it. On the main toolbar click the AutoForm button. That creates a quick and simple form for you.
  3. Click the Design View button to open the new form in Design View. Enlarge the form by dragging the lower right border of the form.
  4. While you are building/designing your form, change to Form View some time to time to preview its looks. Then come back to Design View.
  5. Click inside the horizontal ruler at dimension 2 and drag left until the black box can cover all items on the form, then release the mouse.
  6. Place your mouse on one of the selected items and drag down right until the left border is at 1/4 from the form's left border (as seen on the horizontal ruler; and the top corner is at 1/2 from the form's top border.
  7. Enlarge the forms main right border to 3 5/8. Enlarge the form's bottom border at 1 3/8 on the vertical ruler.
  8. Click inside the horizontal ruler at 1/2, that should select both labels.
  9. Change the font to Times New Roman, size = 12, Bold, color = Blue (6th column, 2nd row).
  10. On the main menu, click Format -> Size -> To Fit.
  11. Inside the horizontal ruler, click on 2, then change the font color to Blue.
  12. Right-click on an empty area inside the form, choose Fill/Back Color -> Choose Light Blue (6th column, 5th row).
  13. Make sure you have the toolbox, otherwise, right-click inside the form and choose and choose Toolbox. On the toolbox, click the Rectangle. Then draw a rectangle that goes from 1/4 top ruler and 1/8 left ruler to 3 3/8 top ruler and 3/8 left ruler.
  14. With the rectangle on the form still selected, on the Formatting toolbar, click the Special Effect button and choose Sunken.
  15. On the toolbox, click the label control and click at 3/8 horizontal and 1/8 veritcal (don't worry, you will adjust it later). Then type Actors - Actresses Registration, and press Enter.
  16. With the new label still selected, change the font to a Serif one (I chose Baskerville Old Face, I think I got it from Corel Draw 6 package; just choose a good but not too wide Serif font), size 14 (I chose 16), Bold, set the color to Light Green (4th column, 5th row). On the main menu, click Format -> Size -> To Fit.
  17. With the new label still selected, press Ctrl + C to copy it. Then press Ctrl + V to paste it.
  18. Still don't touch any of both labels. Set the Color to Navy or Dark Blue (7th column, 1st row).
  19. Now, adjust the positions of both labels so that the lighter of both will create a shadow-like effect to the other. If the lighter label seems to be on top of the other, play with Format -> Bring To Front, and Format -> Bring To Back.
  20. Finally, click the rectangle on the toolbox and draw a small rectangle on the bottom side of the form. Make it look like a wide line, enlarge to be as wide as the largest item of the form. Change its color to Green (4th column, 3rd row). Set its Line/Border width to 1 and its Special Effect to Flat.
  21. Switch to Form View to see the result. On the main menu, click Window -> Size To Fit Form.
  22. Save the form as frmActors.
Tabular Form:
A tabular form is use to edit data in a row when many data details on one table depend on one particular data available on another table.
  1. From the main menu, click Insert -> Form.
  2. In the New form dialog choose AutoForm:Tabular. Set the originating table or query as tblVideoHunctions and click OK.
  3. Switch the form to Design View. The new form has a form header section, a detail section, and a footer section.
  4. Inside the horizontal ruler, click 1/2, that will select the Video Jct ID's ladel and text boxes. resize both so that their right border will coincide with 1/2 on the horizontal ruler. Click the Video Jct ID, that will put it in Edit mode. Change its caption to read Jct ID.
  5. In the horizontal ruler, click 1 1/2 to select the Video Title label and the text box under it. Then drag their left border to 1/16 of the left items.
  6. In the vertical ruler, click 1/8 to select all the (top) labels. On the Formatting toolbar, change the font to Verdana (if you don't have Verdana, choose Arial), size 10, Bold, Underline, Center, Font/Fore Color Blue (6th column, 2nd row).
  7. On the vertical ruler, click 1/8 corresponding to the detail section, that will select all the text boxes. Click the Font/Fore Color button (it should still be set to Blue).
  8. Click the Form Header bar and set the Fill/Back Color to light blue (6th column, 5th row).
  9. Click the Detail bar and click the Fill/Back Color.
  10. Save the form as frmVideoJunctions. Then close the form.
Getting Help In Microsoft Access:
  1. Click the Office Assistant and type Form Design.
  2. Click Create A Form.
  3. Click Create a form on my own.

No comments:

Post a Comment