AutoForm automatically creates a form, always in the same from top to
bottom format. Form Wizard (found on the Forms tab of your database
window) can do a slightly better job, but in general, forms are always
time consuming because of the careful layout needed.
AutoReport automatically creates a report, always in the same from
top to bottom format. Another option is to use Report Wizard, which is
covered in Lesson 5.
The next five choices, Table, Query, Form, Report, and Page, bring up
a choice of how to create a new table, query, form, report, or page. The
same results can be achieved by clicking New
on the corresponding tab of your database window.
These other three choices take you right into a new macro, module, or
class module. The same results can be achieved by clicking New
on the Macros or Modules tab of your database window.
If you get stuck in any of the areas while experimenting, just close
the object you've created and answer no if Microsoft Access asks you to
save the object.
Form view
Now, granted, AutoForm produces a fairly ugly form. But it's just a
starting point. Click the Save button, or
choose File > Save from the menu. Access
defaults to naming the form the same as the table it was created from,
but you're going to call this form frmLeads.
Notice the frm indicates this is a form just as the tbl
in tblLeads indicates it's a table.
Figure 4-2 shows the plain form and at the top of the form, you see
the name, tblLeads, which Access used as the source. This and most other
items discussed here can be edited in Design view.

Figure 4-2: Form view.
Notice that above the form are also some standard buttons you're
familiar with. Remember, just hold your mouse over the button to get its
name. In this view, there are two a new buttons: Properties and Database
Window. The Properties button is a toggle button to show or hide the
Properties window. (The Properties window is covered in detail in the
section on Design view.) The Database Window button brings the database
window to the front.
Notice that when you click the Database Window button, this toolbar
disappears. It's only visible in Form view. Each toolbar is customized
for usefulness.
The toolbar directly above that one (yours may be reversed) is the
Formatting toolbar. All of these buttons should be familiar to you and
if not, try them to see what they do. Note that you can only format the
entire field in Access, not one field at a time. And formatting affects
the field, not the data in the field. Therefore, if you bold the phone
number field, everyone's phone number is bold.
Looking at the form itself, the first field listed is the Autonumber
field. As you tab through all the field names from the table you
entered, you see that Autonumber changes to the next number. It's 1 if
you haven't entered any data and some higher number if you have.
AutoForm has arranged the fields from top to bottom, but you can move
them around in Design view.
The tab key allows you to move from field to field. That's a handy
feature, but if you move the fields around, the tab order won't change
unless you change it. At the end of the form, the tab key goes to the
next record.
Pressing the Shift+Tab keys allows you to move through the tab fields in
reverse.
The scroll bars on the right allow you to move up and down. In Form
view, you only see one record at a time, whereas in Datasheet view you
see all of the records, as if looking at a Microsoft Excel file.
The Navigation buttons at the bottom work just as they do in the
Datasheet view. They allow you to move back and forth through the
records and create new records by clicking the arrow and asterisk
button.
To clean up the form, you use Design view. This is a large topic and
is covered in the following section, but before moving on, a few words
about the other auto objects available to you in Access.
Notice that you have three views available to you in the Forms area.
At the top left, same place as in the tables, there's a Design View, a
Datasheet View, and a Form View. The Datasheet view just reemphasizes
that the form is just a face for the data. All data resides in the
table. If data is changed in the form, it changes in the underlying
table. Click Datasheet View to see a view that
looks just like Datasheet view in the tables.
When you're finished experimenting, click Design
View to move on.

Forms in design view
There's a lot to see in the Design view, so take it one step at a
time. First, if you'll look at Figure 4-3, you'll see a few other
windows floating around on the screen. On the bottom right is a field
list. This lists all the fields available to you for use in this form.
On the top right is the properties box mentioned in Form view. To the
left, you'll see the Toolbox; this has a variety of options for you to
add objects to the form.

Figure 4-3: Design view of a form.
In Design view, you'll find that you can move any of the fields
around anywhere you like.
As you start to experiment, keep in mind that you can always close the
form without saving your work if you make a mistake.
Toolbar
As mentioned earlier, the toolbars are different, depending on where
you are in Access. In the Design view of a form, you have the same
Formatting toolbar as you did in the Form view.
The other toolbar is also the same as the Form view with the
exception of a few buttons. Move your mouse over the items near the
middle of the bar to find the Field List and the Toolbox buttons. These
are toggles that turn the windows on and off.
The next button, Autoformat, gives you a choice of a few designs that
you can apply to your form. If you want it to apply to the entire form,
make sure the black dot is visible in the top-left corner of the form
window (this is the intersection of the vertical and horizontal rulers).
This black dot indicates that the entire form is selected. Otherwise,
Autoformat only applies to selected objects.
The next button is the Code button. It opens a separate window. If
you click this, you won't see code at this point. We cover code in the
following section.
The next button is the Toggle for the Properties window. Next is the
Build button. This is an advanced feature for using Macros, Code, or
Expressions. The last three are the same as in the Form view, Database
Window, new object, and help.
The form
Click any field on the form. When you click any field, you see that
it's identified as selected by little black squares, also call handles,
around it. Figure 4-4 shows multiple selections. You can make multiple
selections by clicking an area without a field, and then dragging the
mouse across the area you want to select.

Figure 4-4: Multiple objects selected.
Notice in Figure 4-4, that there are handles completely around both
the fields and the labels to the left of each field from the top, down
through Contact First Name, but below that, only the field has handles
and the label does not.
After selecting these items, click Bold on the Formatting toolbar.
Notice that the formatting only applies to the objects that have handles
all the way around them.
Now that you have a selection, move your mouse over the selected
fields. The mouse pointer changes to the shape of a hand. If you click
and drag your mouse when the pointer is shaped like a hand, you can move
selected objects.
Notice that the labels that are not selected still move with the
group. That's because labels associated with fields, always move with
the field, unless you move your mouse to the top-left corner of the
field or label. When you do this, you should notice a slightly larger
handle -- even on the labels not selected.
When you place your mouse over this handle, the mouse pointer changes
to a hand with just one finger sticking up. This is your indication that
clicking and dragging results in just that object moving, whether it's a
label or a field.
Try selecting and moving objects around on the form. You can use undo
to step back, or close the form without saving if you just want to start
over.
Field list
The field list is easy to use. Simply click and drag the field you
want to add to the form to the location on the form you want it.
Although this allows you to put multiple fields of the same name on the
form, you can tell when there's an existing field of the same name
because the accompanying label is something generic, such as Text74,
rather than the name of the field as it normally is.
Instead of using AutoForm, you can create a form from scratch. This is
often preferable when there are only a few fields on the form. In the
final section of this lesson, you'll create a form from scratch.
Toolbox
The toolbox is a collection of tools that is just the tip of the
iceberg. More advanced features are available when you later need them.
You'll use a few when creating a form from scratch. The toolbox is
actually just another toolbar. It can be docked or float around, as all
toolbars can. If you move your mouse over the buttons, you will see the
button names.
Properties
This is the most important area of the form. All of your properties
can be set here and it changes as you click different items, so keep an
eye on where you are.
Again, be sure the black dot is visible in the top-left corner. If it
is, the properties box should say Form.
In the Properties window, there are five tabs across the top:
As you click each one, you see a list of different properties
relating to whatever is selected at the moment. Each object on the form
has properties, as well as the form itself. Be sure to click different
objects and then view the tabs.
A quick way to get the Properties window up is to double-click any
object.
As you click each property, you'll see a description in the
lower-left corner of the screen. Don't be afraid to experiment. You
can't break Access and if you make a mistake, undo. If you make too many
mistakes, just close without saving.

Add a button - look at code
In the previous section, you created an AutoForm. Now you're going to
create a form from scratch. This is going to be your menu form. You can
add all your features here and activate them as you finish that part of
the database.
To create the form, follow these steps:
- If you haven't already, close frmLeads.
The database window should now be visible.
- Select Forms and you should see your
lone form: frmLeads.
- Click New > Design View, as shown in
Figure 4-5, and then click OK. You'll see a blank empty form.

Figure 4-5: New Form, Design View.
- Click Save, and then name the form frmMenu.
To modify the form, follow these steps:
- Double-click anywhere in the grey background to open the
Properties menu for the form detail section.
- Click the Format tab, and then click in
the Back Color property.
- Click the Build button (...) to the right to open a palette of
colors. Choose your color, and then click OK.
- On the Toolbox, click the label button (the button with the Aa
near the top- left corner). Your cursor changes to crosshairs with a
capital A. Click anywhere on your form, and then type Main
Menu.
- Press Enter.
You now have a custom form. It doesn't do anything yet, but it's
starting to look pretty. While your label (Main Menu) is still selected,
format it as you wish, changing the font, size, color, and so on, as you
would do in Microsoft Word. If the words become bigger than the label,
double-click any of the black handles to automatically resize the label.
Now you're going to add a button to your form. Follow these steps:
- On the Toolbox, make sure the Control Wizards button at the top is
selected. This bring up a wizard on certain types of tools.

- Click the Command button on the middle right, and then click
anywhere in the form. The Command Button Wizard appears, as shown in
Figure 4-6.


Figure 4-6: Command Button Wizard.
- From the Categories list, choose Form
Operations, and then on the right side, choose Open
Form. Click Next.
- A list of your forms appears. Click frmLeads,
and then click Next.
- Leave Show all records selected, and
then click Next.
- Click Text, rather than Picture and
change the text from Open Form (not very descriptive) to Enter
Leads. Click Next.
- Rather than Command1, rename the button cmdLeads.
The cmd stands for Command button, so that you'll recognize what
control it is when you have multiple controls.
- Click Finish.
Add a second Command button, but this time, just click Cancel when
the wizard comes up. On the Other tab of the properties, change the name
of this button from Command2 to cmdLeadReport.
Double-click the button, and then change the text there from Command2
to Lead Report. You can place the buttons anywhere you want on the form.
Look at the code
Now we're going to do something that some users might find a little
scary. We're going to look at the code for this form. Click your Enter
Leads button, and then click the Event
tab of the Properties window. Notice that On Click
Event has an [Event Procedure]
associated with it.
If you now click your Lead Report button,
you won't see anything on the Event tab. This is because the Command
Button Wizard created code for you on the Enter Leads button.
Now you'll create the code for your Lead Report button:
- In the properties window for the Lead Report button, make sure the
Events tab is selected.
- Click the On Click property, and then
click the Build button ([. . . ]) to the right.
- Choose Code Builder, and then click OK.
- This brings up a Visual Basic window, shown in Figure 4-7. Access
actually uses VBA (Visual Basic for Applications), which is quite
similar, but not identical to VB (Visual Basic).

Figure 4-7: Visual Basic window.
- Looking at Figure 4-7, you see that Access created two lines of
code for you and left your cursor in the middle. Since you want this
button to open a report (which you haven't created yet), enter the
following code: