in our last lesson we learned how to
create a form and now we're going to add
a record using the form the field
properties we set earlier still control
the data that is allowed to be entered
here so for the price field I still have
to make sure I enter the price correctly
but the one thing I don't have to worry
about in this field is the dollar sign
because the data type we set earlier
automatically generates this for me now
the same thing goes for the category
fields we must enter one of the
categories that we told access to accept
so if I enter cars here I get this
message we want to make sure we enter a
category that's actually in the
bookstore but what if we don't have all
the category names memorized an easier
way to make sure we enter a valid
category is to create a drop-down list
that lets us choose which category the
book belongs to right now we don't have
a drop-down list so we have to type in
the category name let's just type in
fiction it's a good idea to save the
information you enter or edit in the
form because sometimes information will
only show up in the table after you've
saved it let's take a look at our books
table to see if our information saved if
the information doesn't show up in the
table you may need to click the refresh
all button now as I said before the form
is just another way to enter date into a
table since the form is supposed to be
an easier way to enter data we'll fix
the category field on the books form by
making a drop-down list let's look at
the books form in design view to make a
category drop-down list we'll select
list box or combo box from the controls
group under the design tab list box
makes a list where you can see several
choices in a list and the combo box
makes them maestro
down menu I'm going to choose the combo
box command from the controls group when
I move my mouse over my form a crosshair
with the combo box icon appears since we
want to add the list to the category
fields I'm going to left-click and draw
a box right on top of the textbox I want
to make sure I line it up just right
I could have decided to delete the text
box but it would have changed the layout
of my form now when you release your
left mouse button this combo box wizard
appears we have three options to choose
from we're going to choose the second
option that lets us type in our own
values this is a good choice for us
since the categories in our store are
pretty constant we don't have too many
categories and we won't be adding new
categories very often so this option
makes sense for us now click Next to
advance on the second screen we're going
to type in our category names in this
area that looks like an Excel
spreadsheet now we only need one column
of choices for the category fields but
if we had more we could change this
number right here
click Next to advance now from this part
of the wizard we'll choose a second
option this option tells access that we
want to save the value that the user
selects from the category list within a
field in the table next we select
category because that is the field we
want to populate so when a user selects
one of the choices in the category
drop-down list it saves that choice in
the category fields of the table on the
next screen we can give our combo box a
name this field is unnecessary so I'm
going to leave it as it is and delete it
from the design view
alright it looks like we're finished
here now if you look closely you'll see
this little box over here to the side of
the drop-down list as I said before it's
not necessary so let's delete it by
selecting it and deleting it and if I
don't delete it it will show up on our
form and it's just an eyesore and
somewhat of a distraction let's go to
the form view so we can see what the
dropdown looks like if I click on the
drop down arrow I can see all of the
categories I entered so now when I enter
a record I can just click here to input
the category now once the data has been
entered in the form go ahead and save it
you may need to refresh the actual table
to have the data show up there
now I showed you how to enter a record
using a form but you can also edit an
existing record using a form in our last
lesson we learn how to use Find and
Replace to change information in the
customers table well it works the same
way with the form right now I'm going to
the navigation pane and open the
customers form
let's find Kiara again this time I want
to change her zip code great I found the
record now on my form I'm going to go to
the zip code field and change it right
here let's save our changes and go back
to the table to see if it's there and
again if not we'll just hit refresh I
told you forms make things easier in the
next lesson you'll learn how to create
very specialized buttons on forms to
control even more of what your user can
enter