IntroductionWelcome| 00:00 | Hi and welcome to Microsoft
Access 2007. I'm David Rivers.
| | 00:04 | When it comes to creating and using
databases on your desktop computer,
| | 00:09 | Microsoft Access is the industry standard.
| | 00:11 | Access is part of certain Microsoft
Office Suite products but not all.
| | 00:15 | You'll need Microsoft Office
Professional, Ultimate, or Enterprise to get
| | 00:19 | Access, along with all the
regulars like Word, Excel, and PowerPoint.
| | 00:23 | In this title we'll begin with a good
foundation covering important database
| | 00:27 | concepts and terminology before
moving into the application itself.
| | 00:31 | Once inside Access 2007 and feeling
comfortable in our new environment,
| | 00:35 | we'll work through a common scenario as we
create a relational database made up of
| | 00:39 | tables, queries, forms, reports and more.
| | 00:44 | Let's get started.
| | Collapse this transcript |
|
|
1. Getting Started with AccessDatabase concepts and terminology| 00:00 | Right before we get into Microsoft
Access 2007, get familiar with the
| | 00:05 | environment, and start creating, we
need to cover some database concepts.
| | 00:09 | So let's talk about a
database and exactly what it is.
| | 00:12 | In its simplest terms, a database is an
organized collection of information and
| | 00:17 | we use organized
collections of information every day.
| | 00:20 | Take for example a telephone book, or
a recipe book, or even a mailing list.
| | 00:23 | Now in Microsoft Access a
database is a little bit more than that.
| | 00:27 | Yes, it is a set of data related to
specific purposes or topics, but it also
| | 00:33 | includes tools that you need to work
with that data, such as tools for sorting
| | 00:37 | and extracting data or even
summarizing it in a nice little report.
| | 00:41 | Another piece of terminology that you
need to be familiar with when working in
| | 00:44 | Microsoft Access is a table.
| | 00:46 | Now a table is just a list of related
information that's sorted into columns and rows.
| | 00:51 | Now each row in the table
would be called a record.
| | 00:54 | Think of the phone book and your
particular information in that phone book would
| | 00:57 | be considered a record.
| | 00:59 | Each column in the table would be
called a category, or in our case, a field.
| | 01:03 | Now a column of phone numbers in that
phone book would be considered the phone
| | 01:07 | number field, for example.
| | 01:09 | Now your actual phone number in the
phonebook is one item of data, and we
| | 01:13 | called that a data value.
| | 01:16 | Now let's talk about relational
database concepts, because when we work with
| | 01:19 | Microsoft Access we're creating what
we call a relational database, and a
| | 01:23 | relational database is not a flat file
database, like a phone book or even a
| | 01:28 | spreadsheet for example.
| | 01:30 | Just think of a mail-order DVD club for
a minute and take a look at this first
| | 01:34 | table here where we've got the name of
a person placing the order, we've got
| | 01:37 | their information like
address, city, state, zip.
| | 01:39 | Then we've got an order number for their
order, the date it was ordered, there's
| | 01:44 | the DVD title and the price.
| | 01:46 | Now what if a customer orders more than one DVD?
| | 01:49 | Well as a business we hope that would
happen, but what then happens in a flat
| | 01:52 | file like this is we get multiple
records containing duplicate information.
| | 01:56 | So take a look at this table now,
where we see David Rivers four times, the
| | 02:01 | address is repeated four times,
so is the city, state, and zip.
| | 02:05 | The order numbers change, but down here,
you can see that we've got the same
| | 02:09 | order number because the same DVD was
ordered twice, maybe one for oneself
| | 02:14 | then one as a gift.
| | 02:15 | So here we've got a very inefficient design.
| | 02:19 | In Microsoft Access when we talk about
relational databases, we mean multiple
| | 02:23 | tables and each table will
pertain to a specific topic.
| | 02:26 | So look at this example here where
I've got all the customers and their
| | 02:30 | information in one table separate from
all of the orders that go into their own
| | 02:35 | table, and then we've got a DVD
Inventory table here that has all the DVD
| | 02:39 | titles and the prices.
| | 02:40 | All we need to do now is simply add
some fields to each of these tables that
| | 02:44 | will contain data that uniquely
identifies each record, and when we talk about a
| | 02:50 | unique identifier, we're
talking about the primary key field.
| | 02:54 | Now the primary key is a field
containing unique data values to identify
| | 02:58 | each record in a table.
| | 03:00 | So if you look down here at the Customers
table, we've added the Customer ID field.
| | 03:04 | Over here, we've got the Order Number
field, and in the DVD Inventory, each DVD
| | 03:09 | will get an ID that is unique.
| | 03:11 | So in other words we will not have two
Customer IDs in the Customer tables that are the same.
| | 03:16 | In the Orders table each order will
have its own unique number, and same thing
| | 03:20 | for the DVD Inventory table where
each DVD has its own unique identifier.
| | 03:26 | So because each of these tables is
linked by a common field, and you can see
| | 03:30 | going from Customers over to Orders,
we've got the Customer ID field in here,
| | 03:34 | and then from the DVD Inventory table
we've got the DVD ID showing up in the
| | 03:38 | Orders table as well.
| | 03:40 | This makes them related or will
be called a relational database.
| | 03:44 | Now relationships need to be
explained a little bit too because each
| | 03:47 | relationship will consist of a primary
table, sometimes called the parent, and a
| | 03:51 | related table that we often call the child.
| | 03:54 | The primary table usually
contains the primary key fields.
| | 03:57 | So over here we've got Customers table
with the Customer ID as the primary key,
| | 04:02 | and over here in the Orders table you
see Customer ID does show up, but it's
| | 04:05 | not a primary key and that means that
this Customer ID can show up many times
| | 04:10 | in the Orders table.
| | 04:11 | That's exactly what we want.
| | 04:13 | We want the same customer placing many orders.
| | 04:17 | Now when we talk about relationships,
that's how tables are related, there's
| | 04:21 | another key concept you need to understand.
| | 04:23 | Typical relationships
include one-to-one and one-to-many.
| | 04:27 | Those are the two main types of relationships.
| | 04:29 | A one-to-one relationship exists when
the primary record has only one related
| | 04:34 | record in that child or related table.
| | 04:37 | So here you can see we've got customer
information and their address and then
| | 04:41 | we've got a billing table for example,
where a billing address would show up for
| | 04:44 | each customer, and they're only
allowed one billing address, so you can see
| | 04:48 | we've got the primary key
here showing up in both tables.
| | 04:52 | Now, the one-to-many relationship is actually
the more related records in the related table.
| | 04:56 | So here you can see where we've got
Customers listed in our Customers table, the
| | 05:01 | Customer ID exists only once in this
table, and that's because Customer ID is
| | 05:06 | the primary key, but we do see that
same Customer ID repeated many times in the
| | 05:10 | Orders table as the customer places each order.
| | 05:14 | Notice also that the Customer ID here is
not a primary key, not in the Orders table.
| | 05:20 | So now we need to understand
something called normalization.
| | 05:23 | We need to be able to organize
our data into smaller tables.
| | 05:27 | And that's part of normalization,
and the reason we do that is to
| | 05:30 | prevent redundant data.
| | 05:31 | We saw that earlier where a
name and addresses and so on were
| | 05:34 | repeated throughout a table.
| | 05:36 | By separating them into separate
tables we avoid that redundancy.
| | 05:39 | That improves our manageability of
our database, improves the speed and
| | 05:43 | efficiency that we can work with the
data, and then it makes creating or
| | 05:47 | designing queries, forms,
and reports that much easier.
| | 05:50 | You'll see this when we
get in to Microsoft Access.
| | 05:53 | So the things we need to do in
normalization is determine how many tables
| | 05:57 | we're going to need, determine what
fields we're going to need, and then focus
| | 06:01 | in on that primary key.
| | 06:03 | There's actually five forms of
normalization, but we're going to talk about the
| | 06:06 | main three, that usually
allow us to achieve normalization.
| | 06:10 | Database design theory includes
standards and guidelines, and they're
| | 06:13 | called normal forms.
| | 06:14 | to help us create a normalized database.
| | 06:17 | So once primary keys are determined,
normalization can start to take affect.
| | 06:22 | There are five normal forms, like I
mentioned, and they have to be created in
| | 06:27 | order, or performed in order, but
most databases like I said achieve
| | 06:30 | normalization after the third normal form.
| | 06:33 | So that's what we're going to focus on:
| | 06:34 | normal forms 1 through 3.
| | 06:36 | So normal form one here, is
where we break each field down to its
| | 06:39 | smallest meaningful value.
| | 06:41 | You can see in this table here
where I've got a Customer ID, I've got
| | 06:44 | names, addresses, etc.
| | 06:45 | Well in the Name field I've
got a first and a last name.
| | 06:48 | In the address I've got the
street, the city, the state.
| | 06:50 | This is the same information in a
table that's been broken down into those
| | 06:55 | smallest meaningful values in separate fields.
| | 06:58 | Here you can see I've got a
first name and a last name.
| | 07:00 | The address has the street address, the
city, the state and zip, and look down
| | 07:04 | here where we've got family members.
| | 07:06 | We've got separate fields for
Spouse, Child 1 and Child 2.
| | 07:09 | One of these records has blank fields,
so here's someone with no dependants.
| | 07:14 | So we'll keep that in mind as we move
into the next step in normal form 1.
| | 07:19 | We want to remove repeating groups of
data and create a separate table for each
| | 07:23 | set of the related data.
| | 07:24 | So those dependants for example, if
we separate them from one table into
| | 07:28 | their own table, you can see we can
just refer to the Customer ID and keep
| | 07:32 | track of their dependants.
| | 07:33 | For example, if this person here,
Customer ID 433, Dave Rivers, was to add a new
| | 07:39 | dependant, there wouldn't be room in
the original table, but over here in this
| | 07:43 | table, we simply add another record
433 and the name of the dependant.
| | 07:46 | It also means that we don't have any
blanks like we saw in the previous table.
| | 07:51 | So that's the next step in normalization.
| | 07:54 | Then we get to normal form 2, and
here's where we create new tables for data
| | 07:58 | that applies to more than one record
in a table and we add a related field,
| | 08:02 | that's called a foreign key, to the new tables.
| | 08:04 | So here's that example again, where
we've got customers and then over here you
| | 08:09 | can see they belong to a store and the
stores each have their own ID, so all we
| | 08:13 | need to do is put in a store ID.
| | 08:15 | Normal form 3 is where we remove fields
that do not relate to or provide a fact
| | 08:20 | about the primary keys.
| | 08:21 | So in a table, you look at that
primary key, if you see fields that don't
| | 08:24 | actually relate to the primary key, you
can put them off in their own tables and
| | 08:28 | link those tables through a common field.
| | 08:30 | So take a look at this example here
where we've got Customers and then the Store
| | 08:34 | Code is in the Stores table, and
there's the link from Store Code here to Store
| | 08:39 | Code over here, and then Dependants,
we saw that in the earlier example where
| | 08:44 | the Customer ID is related
to its various dependants.
| | 08:47 | So here you can see the types of
relationships we're talking about.
| | 08:51 | In the Customers table, Customer ID is the
primary key, so it will always be unique.
| | 08:55 | That means we've got a one-to-many relationship.
| | 08:58 | In the Dependants table we'll see
that customer ID repeated many times, for
| | 09:02 | every order, for example, or for
each dependant as they're added.
| | 09:06 | Also down here, you can see Stores.
| | 09:08 | The Store Code is going to exist once
only in the Stores table, but we'll see
| | 09:13 | the Stores Codes showing up with the
various customers repeated many times in
| | 09:17 | the Customers table, so
there's the one-to-many relationship.
| | 09:21 | So the 1 and then the
infinity symbol represents the many.
| | 09:24 | All right let's talk about a real-life
scenario that we're going to use as we go
| | 09:28 | into Microsoft Access and use some of
these concepts and create our own database
| | 09:33 | or relational database.
| | 09:35 | Let's say we currently own several
albums on CD, tape and vinyl, and we want to
| | 09:39 | get those organized so it's
easy to find songs or albums.
| | 09:42 | We also want to be able the search by
media, genre, the artist, the year or the
| | 09:47 | decade, and maybe apply a ranking that
we can use to look up songs and albums.
| | 09:51 | Maybe we want to be able to search for
albums based on a star rating as well, so
| | 09:56 | our favorite albums.
| | 09:57 | And we want able to add new albums of course,
at any time as we acquire new CDs tapes etc.
| | 10:03 | So that's what we're going
to do in Microsoft Access.
| | 10:06 | Let's move on to launching the actual program.
| | Collapse this transcript |
| Starting Access| 00:00 | It's time now to load Microsoft Access 2007
and get acquainted with our new environment.
| | 00:06 | Before we can start creating tables and
queries, reports and forms, and so on we
| | 00:10 | need to be comfortable in our new
environment, and if you're brand-new to
| | 00:14 | version 2007 of Microsoft
Access, you'll see some changes.
| | 00:17 | Now I'm using Windows Vista, so when I
come down to the bottom left-hand corner
| | 00:21 | my Start button looks like this.
| | 00:23 | In Windows XP the Start button is in the
same location, but it has the word Start on it.
| | 00:27 | We're going to give that a click.
| | 00:29 | Now in Vista, I get a list
of recently used applications.
| | 00:32 | You can see them all listed here, one of
them happens to be Microsoft Access 2007.
| | 00:35 | So if I was to click this I would
launch the application, but I'm going to
| | 00:40 | pretend that's not there.
| | 00:42 | The very first time you use
Access, it will not be on this list.
| | 00:45 | So down at the bottom here where it
says Start Search I can click and start
| | 00:49 | typing in the work Access and look what happens.
| | 00:52 | I just typed acc and you can see
what's happening, Microsoft Access shows
| | 00:56 | up right at the top. Perfect.
| | 00:57 | I can launch it from here.
| | 00:59 | I've got some other programs listed
here that either have Access in the name or
| | 01:03 | are related to Access.
| | 01:05 | Then I've got files as well down below, with
access in the name or Access files. Kind of neat.
| | 01:11 | Makes it really easy to find
your applications and launch them.
| | 01:14 | Now let's just pretend we
don't have Windows Vista.
| | 01:16 | We're working in XP.
| | 01:18 | We come down to the Start button, just
like XP in Vista we have All Programs.
| | 01:23 | I can just hover over that without
clicking it to get a list of all of my options.
| | 01:27 | Now at the top of this list, and
I'm going to scroll up, you can see
| | 01:30 | actual applications.
| | 01:32 | These are actual programs I
can launch right from here.
| | 01:34 | As I scroll a little further down I'm
going to see the one I'm looking for,
| | 01:38 | which is Microsoft Office.
| | 01:39 | Clicking Microsoft Office is going
to expand that to show me all of the
| | 01:43 | applications in that folder, and
right at the top is Microsoft Access 2007.
| | 01:46 | So I'm going to give that a click.
| | 01:49 | All right so we're into Microsoft
Access now and you will be greeted with this
| | 01:55 | seemed Getting Started screen that you
see in front of you here, but before we
| | 01:58 | go into detail on the Getting Started
screen, I want to get you familiar with
| | 02:02 | your environment here, so going up to
the very top left corner, you'll see I've
| | 02:06 | got the Office button, and the Office
button is very familiar to people who are
| | 02:11 | accustomed to using the
File menu in previous versions.
| | 02:15 | When I click the Office button, you'll
see some file related commands like New,
| | 02:19 | Open, there's some Save buttons, Print,
Manage, E-mail, Publish, and there's
| | 02:25 | where I go to close a
database once I've got one open.
| | 02:27 | Right now many of these buttons are not
accessible because I don't have anything
| | 02:31 | open to work with yet.
| | 02:32 | I also have a list of recently used documents,
which happen to be databases in this case.
| | 02:38 | You can see them listed here and I can
also access, no pun intended, my Access
| | 02:43 | options down here by
clicking the Access Options button.
| | 02:46 | We'll talk about that later as well.
| | 02:48 | Here's another way to exit
Access if I'm done with it.
| | 02:52 | I'm not going to select anything from
here, so I'm going to click outside the
| | 02:54 | menu to disable it, and go back up
to the top left corner cause we've got
| | 02:58 | something here, called
the Quick Accesss toolbar.
| | 03:00 | This is new to Office 2007.
| | 03:03 | The Quick Access toolbar is going to have a
number of commands that you use most often.
| | 03:08 | Now in this case, you can see I've got
a Save, Undo, and Redo buttons showing
| | 03:12 | up here by default, but we can
totally customize this and we will do that a
| | 03:16 | little bit later on.
| | 03:18 | So we'll get all of the commands that
you're accustomed to using on a regular
| | 03:21 | basis, or most frequently,
and we'll put them up here.
| | 03:25 | Now across the title bar where we see
Microsoft Access, on the right hand side,
| | 03:28 | we've got some buttons that
should look familiar to you.
| | 03:31 | The minimize button, so if we want to
keep Access running and just minimize it,
| | 03:35 | that throws it down on our taskbar.
| | 03:37 | If I come back down to the bottom
on my screen, it's still running.
| | 03:39 | I can give it a click to
resume where I left off.
| | 03:43 | Over here, because Access currently
fills my entire screen. It's maximized.
| | 03:48 | This is a Restore Down button.
| | 03:50 | When I click it you can see that the
window is restored down to a default size.
| | 03:54 | Now this size might not be the best size
to work in, so we can maximize, now the
| | 03:59 | middle button is a Maximize
button to fill the entire screen.
| | 04:03 | That's how I like to work personally.
| | 04:05 | The Close button is in the
top right corner. It's red.
| | 04:08 | This will close the application, the
same as going to the Office button and
| | 04:11 | choosing to Exit Access.
| | 04:13 | Right below that is our Help button.
| | 04:15 | So any time you see this little circle
with a ? inside, that's your Help button
| | 04:20 | and F1 on the keyboard is the shortcut.
| | 04:23 | So we can access Microsoft Office
Help as well as Microsoft Office Access
| | 04:28 | Help and all of the help that appears online
as well, if you're connected to the Internet.
| | 04:33 | All right in the middle section
here is our Getting Started area.
| | 04:37 | We're going to talk about that in the
next lesson in great detail, so let's move
| | 04:40 | down to the bottom where we have our status bar.
| | 04:43 | Status bar gives you information as you
work on the various objects in Microsoft
| | 04:47 | Access, and right now you'll
see that our status is Ready.
| | 04:50 | So it's very important that we look
down here when we're working on certain
| | 04:54 | portions of Microsoft Access, because
we'll get messages down here telling us
| | 04:58 | whether or not we're allowed
to save something or move on.
| | 05:01 | Always check down on the
status bar to get the latest status.
| | 05:04 | All right so those are the
basics of our environment.
| | 05:07 | In the next lesson we're going to go
into great detail talking about this
| | 05:10 | Getting Started screen you
see in front of you here.
| | Collapse this transcript |
| The Getting Started window| 00:00 | In the previous lesson we launched
Microsoft Access from the Start button in
| | 00:04 | Windows, and this is how we were greeted
with the Getting Started with Microsoft
| | 00:08 | Office Access screen.
| | 00:09 | You'll always see the Getting Started
screen here every time you launch Access.
| | 00:13 | The only time that you won't is if
you create a database and then create a
| | 00:16 | shortcut to that database that you
can double-click directly from the
| | 00:19 | Desktop, for example.
| | 00:21 | So going directly to a database you've
already created will bypass this screen,
| | 00:25 | but every time you go right to the
Access icon, either through the Start button
| | 00:28 | or double-clicking it on the Desktop
for example, you'll be greeted by this
| | 00:32 | Getting Started screen.
| | 00:33 | So we need to get familiar with this
cause it will help you get started the
| | 00:36 | first time using Access 2007.
| | 00:37 | Now you can see there's three sections here.
| | 00:40 | Over on the left I've got Template Categories.
| | 00:43 | In the middle I see Getting Started with
Microsoft Office Access, and I will see
| | 00:47 | whatever is selected over here down the
middle, and then on the right hand side.
| | 00:51 | I've got an opportunity to either open
an existing database or one of the most
| | 00:55 | recently used databases in Access.
| | 00:58 | So let's talk about these sections quickly.
| | 01:00 | Over here on the left you can see
Featuring is selected, and because it's
| | 01:04 | selected here under Template
Categories, if I go over to the middle section
| | 01:07 | under Getting Started yes, I can
create a new blank database from scratch.
| | 01:12 | It won't contain any objects, won't
contain any tables or forms or reports, or
| | 01:17 | down below you'll see I've got
Featured Online Templates, and that's because
| | 01:21 | Featuring is selected over here on the left.
| | 01:23 | Now all of these, for example Assets,
Contacts, Issues, etc., are online
| | 01:29 | templates that I can access if
I'm connected to the Internet.
| | 01:32 | What that does is it
gives me a great head start.
| | 01:34 | If I wanted to compile a list of my
contacts and their information, I can click
| | 01:38 | Contacts here, create a new database
that will have tables with the proper
| | 01:42 | fields for me to use already created.
| | 01:44 | In other words, it's going
to save me a ton of work.
| | 01:47 | Now, if I'm not connected
to the Internet, no problem.
| | 01:50 | I'm going to come over here and click
Local Templates, and you can see when I do
| | 01:53 | that I get a number of the same
categories here like Assets and Contacts and so
| | 01:58 | on, but all of these templates are
actually stored locally on my hard drive.
| | 02:02 | So I can access them, get a nice jump
start creating my own database by using
| | 02:07 | one of these templates.
| | 02:09 | Now over here on the left under From
Microsoft Office Online, again we're
| | 02:12 | talking about being connected to the
Internet, cause when I come over here to
| | 02:16 | Business, I'm going to see a bunch of
business templates that I can access from
| | 02:20 | Microsoft Office Online.
| | 02:21 | So Assets is there, Contacts is there,
there's Issues and Events, but there's a
| | 02:25 | whole bunch of other ones we didn't see
earlier, like Business account ledger,
| | 02:29 | there's a Call tracker database.
| | 02:31 | Look down here at a
Lending library, I like that one.
| | 02:34 | So clicking any of these will
actually borrow the template from a location
| | 02:38 | that's online at Microsoft and get
me started creating my own database,
| | 02:42 | using some of the objects that
would be used in for example, a Lending
| | 02:46 | library here selected.
| | 02:47 | Under Education, I've
got a number of other ones.
| | 02:50 | I've got Faculty and Students.
| | 02:52 | Under Personal if I want to create any
of my own personal databases like a Home
| | 02:57 | inventory, a Lending library, there
it is again, Personal contact manager,
| | 03:01 | Nutrition that's a neat one.
| | 03:03 | So lots of opportunity here to
get a jumpstart in Microsoft Access.
| | 03:07 | I don't have to create
the database from scratch.
| | 03:10 | I've got tons of templates.
| | 03:11 | I've even got a sample database here.
| | 03:13 | When I open this up, I'll see all of
the tables, the reports, the forms, etc.
| | 03:17 | that comprise this database, and
that'll help me learn how to create my own.
| | 03:21 | I'm going to go back up to
Featuring where we started.
| | 03:25 | Now like I said we can create a new
blank database without using a template,
| | 03:29 | that means we're creating all of our
tables and every field in the table, every
| | 03:33 | form, every report from scratch.
| | 03:36 | On the right now, once we've created a
database here's where we go to open it up.
| | 03:39 | Now I can go to my Office button up
here and choose Open, that's one way.
| | 03:44 | Notice also I've got Recent Documents
listed here, which are recent databases,
| | 03:48 | and it's the same list as I see
over here on the right-hand side.
| | 03:51 | So this just another way to
open an existing database.
| | 03:54 | If it's one that I've worked with
recently, it'll show up on this list.
| | 03:57 | If you haven't created one yet, your
list will be empty, but clicking More,
| | 04:02 | right up here, will allow me to go
browsing through my hard drive, network
| | 04:05 | drives, etc., to find an existing database.
| | 04:08 | Clicking it and choosing Open
will bring it up on my screen.
| | 04:11 | I'm going to click Cancel.
| | 04:14 | So that's the Getting Started screen.
| | 04:16 | Again, if you're new to Microsoft
Access, it's a great way to get rolling.
| | 04:19 | If you want to use some of the
templates and you're connected to the Internet,
| | 04:22 | you've got a huge opportunity here.
| | 04:25 | If you're not connected to
the internet, no problem.
| | 04:27 | There are a number of local
templates stored on your hard drive with the
| | 04:31 | installation to help get you started.
| | 04:33 | Next we're going to look at how we
actually modify what we see up here in the
| | 04:37 | top left corner on our Quick Access toolbar.
| | Collapse this transcript |
| The Quick Access toolbar| 00:00 | Now that we're familiar with the
Getting Started screen that greets you every
| | 00:03 | time you launch Access, it's time to
get a little more familiar with the Quick
| | 00:07 | Access toolbar up here in the top left
corner because you'll probably end up
| | 00:11 | using it quite a bit.
| | 00:12 | Now by default, you can see up here I've
only got three buttons showing up on my
| | 00:16 | Quick Access toolbar:
| | 00:17 | the Save button, Undo, and Redo.
| | 00:20 | Right now I can't use any of them,
because I don't actually have a database open
| | 00:24 | to save, and I haven't done anything
yet that I can undo, and of course if I
| | 00:28 | haven't undone anything there's nothing to redo.
| | 00:30 | So, how do I get some more
buttons showing up there?
| | 00:33 | For example, I like to do a
Print Preview on a regular basis.
| | 00:36 | How do I get that up there?
| | 00:37 | Well, you'll notice just to the right
of the last button I've got a little drop
| | 00:40 | down and when I click that, you'll see a
number of commands showing up, commonly
| | 00:45 | used commands like New, Open, E-mail.
| | 00:48 | There are some Quick Prints and
Print Preview options, Spelling.
| | 00:51 | The ones that are already checked
off are the ones that show up on the
| | 00:54 | Quick Access toolbar.
| | 00:56 | So if Quick Print is something that I
use a lot, I'm going to give it a click
| | 00:59 | and you'll see that that button now
appears on my Quick Access toolbar.
| | 01:04 | Now what if I also like to export to
an Excel spreadsheet on a regular basis.
| | 01:08 | It would be nice to have a shortcut
button up here, so I don't have to go
| | 01:11 | through the Office button and finding it.
| | 01:13 | I'm going to click the drop-down, and
I'm going to come down to More Commands,
| | 01:17 | and here's where I can
see pretty much everything.
| | 01:19 | Not only can I see additional commands,
but here's where I can go to reorder the
| | 01:24 | way that the buttons appear
on my Quick Access toolbar.
| | 01:26 | So the first thing I'm going to do
is add Export to Excel spreadsheet, by
| | 01:30 | clicking it and then clicking the Add
button to move it over, and now you can
| | 01:34 | see that they show up in
the order that they're added.
| | 01:37 | Now Quick Print, I want next to Save,
so I'm going to click on Quick Print, and
| | 01:41 | I'm going to bump it up
twice, so it's next to Save.
| | 01:43 | Then I've got Undo, Redo, and Export
to Excel spreadsheet. That's perfect.
| | 01:49 | So right now I'm looking at a list of
popular commands down here, and you can
| | 01:53 | see it's a partial list.
| | 01:55 | If I click this drop down, you can
see I've got all kinds of other choices,
| | 01:59 | Commands that are not in the Ribbon, Macros.
| | 02:02 | Under the Office menu, you can see
I've got Print Preview, Home, Create, etc.
| | 02:07 | Then I've got a whole bunch down here for forms,
relationships, lots and lots of options here.
| | 02:15 | Now each one of those is a
category that contains its own commands.
| | 02:18 | So if I wanted for example Macro commands,
clicking on Macros will show me if I've got any.
| | 02:23 | A list of Macro commands down below,
like a separator here for example.
| | 02:27 | If I go back up here to All
Commands, I'm going to see every possible
| | 02:32 | command, and there's a lot.
| | 02:35 | You can see, as I scroll down,
there's tons and tons of commands.
| | 02:38 | So if there's one that you like to use
over and over and over again, you'll find
| | 02:42 | it on this list, you'll add it to your
Quick Access toolbar, and when you come
| | 02:46 | down here and click OK, you'll see
your updated Quick Access toolbar.
| | 02:51 | So here you can see now I've got Save,
there's my Quick Print, Undo, Redo, and
| | 02:55 | my Export to Excel button.
| | 02:57 | Now if I go back to this drop down
there's something else you need to know about.
| | 03:00 | We can change the location
of our Quick Access toolbar.
| | 03:04 | If you don't like it up there in the top left
corner you can also show it Below the Ribbon.
| | 03:08 | Now, right now we're not seeing the
ribbon because we haven't actually opened up
| | 03:11 | a database yet and we will get into the
ribbon in detail in an upcoming lesson,
| | 03:16 | but if you don't like it up there at
the top, you can move it below the ribbon
| | 03:19 | where it's a little bit easier to access.
| | 03:21 | For example, we're going to leave it
right where it is, but just so you know,
| | 03:24 | you can move it by
clicking Show Below the Ribbon.
| | 03:28 | I'm not going to select from there.
| | 03:29 | I'm going to click off of the menu to
deselect it and leave my Quick Access
| | 03:33 | toolbar just the way I see it here.
| | 03:35 | You can see there's lots of room up
here on the title bar to add more and more
| | 03:39 | buttons if you so choose.
| | 03:41 | Keep in mind, it's a great way to
access some of the more commonly used
| | 03:45 | commands, customizing it to
exactly the way you use Access.
| | Collapse this transcript |
| Opening an existing Access database| 00:00 | Very shortly you're going to
be creating your own database.
| | 00:03 | So once you've done that, how do you open it up?
| | 00:05 | Also, we need to get familiar with
the Access environment, past the Getting
| | 00:08 | Started screen here.
| | 00:10 | So we'll need to open up an
existing database to do that.
| | 00:13 | That's what we're going to do now and
there's a couple of different ways to open
| | 00:16 | up a database that already exists.
| | 00:18 | One way is the Office button.
| | 00:20 | If you're accustomed to using other
applications like Microsoft Word or Excel
| | 00:24 | for example, you know you can click
the Office button, come down to the Open
| | 00:28 | button and give it a click, Control+O
on the keyboard is the shortcut, and then
| | 00:32 | navigate to the Lesson1
folder of your Exercise Files.
| | 00:35 | You'll find Personal Inventory there.
| | 00:37 | Clicking that, and then clicking
Open will bring it up on the screen.
| | 00:40 | All right, so here's my Home
Inventory list that's somewhat started.
| | 00:45 | I'm going to close that by going back
to the Office button, and I'm going to
| | 00:49 | come down to Close Database.
| | 00:51 | I don't want to go up to the red x in
the top right corner, cause that will
| | 00:54 | close Access altogether.
| | 00:56 | Another way to open up an existing
database is from over here on the right hand
| | 01:00 | side of the Getting Started
screen under Open Recent Database.
| | 01:04 | Now I can come right here to this top
one, that's the one I most recently used;
| | 01:08 | my Personal Inventory.
| | 01:09 | Click it once and again, it opens it up for me.
| | 01:12 | I'm going to close that down one more
time, and show you a couple other ways.
| | 01:18 | Now, if the database does not show
up on your most recently used list of
| | 01:23 | databases, you can click More.
| | 01:26 | Again you would navigate to your
Exercise Files, go to the Lesson1 folder by
| | 01:32 | double-clicking and find
Personal Inventory and click Open.
| | 01:36 | I'm going to click Cancel.
| | 01:37 | That's three different ways to open
up an existing database, but I want to
| | 01:41 | show you another option.
| | 01:42 | I'm going to minimize Access, keep it running
but just minimize it, and come to my Desktop.
| | 01:47 | Here, I can create a shortcut to the
actual database and bypass that Getting
| | 01:51 | Started screen we saw earlier.
| | 01:53 | So by right-clicking here in the Desktop,
and coming down to New and selecting
| | 01:58 | Shortcut, I can now browse to that
database file by clicking the Browse button,
| | 02:04 | and I need to go up to my Desktop here,
down to Exercise Files, I'm going to go
| | 02:10 | into my Lesson1 folder, and there it is:
| | 02:12 | Personal Inventory.
| | 02:13 | So when I click on it and I click OK,
all I have to do is hit the Next button
| | 02:18 | now to see the name that's going to
show up and I can change that if I want.
| | 02:22 | Personal Inventory's good;
| | 02:23 | I'm going to leave that there and click Finish.
| | 02:26 | Now I've got a shortcut to my actual database.
| | 02:29 | So I don't have to launch Access.
| | 02:31 | I can go right in here, I can double-
click Personal Inventory, it will launch
| | 02:34 | Access and take me directly to my
database called Personal Inventory.
| | 02:40 | So there you have a few different
ways to open up an existing database.
| | 02:44 | Next we're going to get used to
and familiarize ourselves with this
| | 02:47 | new environment.
| | Collapse this transcript |
| The work environment| 00:00 | So we now have a database
open from the previous lesson.
| | 00:03 | You can see the name of it
up here on the title bar:
| | 00:05 | Personal Inventory.
| | 00:06 | It's an Access 2007 database.
| | 00:09 | We open it up from the Lesson1 folder
of the Exercise Files and because we've
| | 00:13 | got this open in Access 2007, there are
some new things in this environment we
| | 00:18 | need to talk about before we
move on and start creating your own.
| | 00:22 | First of all across the top we've got
something now called the Ribbon, and
| | 00:25 | there's actually four tabs up here for Home,
Create, External Data and Database Tools.
| | 00:32 | Each one of those is a
separate ribbon on its own.
| | 00:34 | The ribbon contains sections with
a number of commands that are most
| | 00:38 | frequently used and the tools you
need when you need them will show up
| | 00:43 | depending on what you're working on.
| | 00:44 | In other words, the ribbon is context sensitive.
| | 00:47 | So if I come down below here and I'm
looking at the Home Inventory List form,
| | 00:52 | the form has buttons for creating new
assets, collecting data, e-mailing, etc.
| | 00:57 | I'm going to click right
here inside one of these fields.
| | 01:00 | As soon as I did, a number of
tools became accessible to me.
| | 01:04 | I'm going to talk about the different
tabs in the ribbon, and the different
| | 01:07 | sections down below.
| | 01:08 | Currently on the Home tab you'll see
I've got a View section, the Views drop
| | 01:12 | down to look at Forms, Layout, and Design Views.
| | 01:18 | Over here I've got a Clipboard
section, and here's where I would go to
| | 01:22 | Cut, Copy, and Paste.
| | 01:23 | Right now none of these buttons is accessible.
| | 01:25 | If I were to click and drag over Office
Desk, for example, you'll see now that
| | 01:30 | the Cut and Copy buttons are available to me.
| | 01:32 | Next we've got the Font section.
| | 01:34 | The Font section contains
all of the font commands.
| | 01:37 | With this highlighted text I may
want to change the font, the size, the
| | 01:41 | alignment, the appearance with
bold, italics, underline, the color.
| | 01:46 | I can even work with the
grid lines, if I wanted to.
| | 01:49 | Another thing I want you to know is
that any time you see a group with a
| | 01:52 | little arrow on the bottom right-hand corner,
it means we can open it up to show even more.
| | 01:56 | So I'm going to click this under Font.
| | 01:58 | You can see I've got
Datasheet Formatting showing up now.
| | 02:01 | So I can do cell effects.
| | 02:03 | There's my grid line options again.
| | 02:05 | I can do background colors.
| | 02:07 | I can do gridline colors, all kinds
of cool things on top of these font
| | 02:12 | options that you see here.
| | 02:13 | I'm going to click Cancel.
| | 02:15 | So just keep in mind every time you see
one of these little guys in the bottom
| | 02:18 | right corner, there's more that you can
bring up that's related to that section.
| | 02:23 | There's a Rich Text section here for
working with numbered and bulleted lists,
| | 02:27 | indenting and that kind of thing.
| | 02:29 | In the Records section you can
see I can refresh my records.
| | 02:33 | I can create new records.
| | 02:34 | So if I had a new inventory item that had
to go on my list, I could use the New button.
| | 02:39 | That's one way of creating a new item.
| | 02:41 | Here's where I can save my records,
delete records, total up records, there's a
| | 02:46 | spelling option and more.
| | 02:48 | I've got a sort and filter option
for sorting the data that you see here.
| | 02:52 | I can sort it alphabetically.
| | 02:55 | You can see ascending or descending, and I can
choose which of these fields I want to sort by.
| | 03:00 | I've also got a filtering option, so I
can only see the stuff I want to see.
| | 03:04 | There's a Wizard button here.
| | 03:05 | Any time you see the little lightning
bolt, you'll know there's a Wizard built
| | 03:08 | into that to help you create the filter.
| | 03:11 | I've got a find section that includes
Find and Replace options, Go To as well.
| | 03:16 | And I've got other tabs.
| | 03:17 | I've got a Create tab up here.
| | 03:20 | Now clicking the Create tab's
going to show me, guess what?
| | 03:22 | A number of create options,
and what can I create?
| | 03:26 | I can create Tables, Forms, Reports,
and over in the other section I can create
| | 03:32 | Queries and Macros, all from this ribbon.
| | 03:34 | So if I want to create a table from
scratch, I can come up here, a new blank table.
| | 03:39 | If I want to base it on an existing
template, I can use table templates.
| | 03:43 | If I want to use SharePoint services I
can go here, and if I want to adjust the
| | 03:47 | design of any table I do create I
can go to the Table Design view.
| | 03:52 | Same goes for Forms.
| | 03:53 | There are three different
form looks to choose from.
| | 03:55 | Here is a Basic Form, a Split Form,
and Multiple Items type forms.
| | 04:00 | Here's my Blank Form from scratch.
| | 04:02 | More forms appear down here and
there's a design button for working with
| | 04:06 | form design as well.
| | 04:08 | Same goes for reports:
| | 04:09 | creating Reports, blank ones.
| | 04:11 | There's a Report Wizard to help me,
and look at that, another design button.
| | 04:16 | Same goes for creating queries.
| | 04:18 | There's a Query Design button, and we also have
the ability to create macros to automate tasks.
| | 04:23 | We'll look at all of this stuff later on.
| | 04:25 | The External Data tab, guess what?
| | 04:28 | We can work with data outside of Access.
| | 04:30 | We can import or export that data.
| | 04:33 | If we import on a regular basis
from another Access database, an Excel
| | 04:37 | spreadsheet, a SharePoint
service, a text file, whatever.
| | 04:40 | If we do that over and over and over again, we
may want to save that import and automate that.
| | 04:45 | The same goes for exporting data to Excel
spreadsheets, or Word files, or text files.
| | 04:51 | If we do that on a regular basis, we
may want to save those exports as well.
| | 04:55 | There's a Collect Data section for
working with e-mails and managing replies,
| | 04:59 | and then there's a whole SharePoint
section, which is fairly advanced and we'll
| | 05:02 | save that for another title.
| | 05:04 | Up at the top we've got one
last tab, the Database Tools tab.
| | 05:07 | It shows us the database tools ribbon.
| | 05:09 | You can see we've got a Macro section in
here for running macros and if you're a
| | 05:13 | programmer, you'll know all about Visual Basic.
| | 05:14 | There's a Show/Hide section for
showing and hiding relationships and
| | 05:19 | object dependencies.
| | 05:20 | We'll talk about that later on too.
| | 05:22 | Analyzing our database is
important, with the Database Documenter.
| | 05:26 | We can analyze the performance of our database
to make sure it's working at its upmost peak.
| | 05:31 | You can see, we can analyze
tables as well, within our database.
| | 05:34 | Moving data is important.
| | 05:35 | Using SQL Servers and Access Databases.
| | 05:38 | And then we've got Database Tools
over here, like creating security options
| | 05:42 | using encryption and passwords,
a Switchboard Manager as well.
| | 05:45 | We'll look at those later on in this title too.
| | 05:48 | I'm going to go back to the Home tab now,
and just keep in mind that depending
| | 05:52 | on what we're working on down below,
this ribbon is always changing, always
| | 05:56 | offering up the tools we need at
our fingertips when we need them.
| | 06:00 | Down the left-hand side we've got a
Navigation pane as well, and you'll notice
| | 06:03 | there's a double arrow at the top, this
is our Shutter Bar to open and close our
| | 06:08 | Navigation Pane, or we can click
right on the Navigation Pane here, when it
| | 06:12 | lights up to show the Navigation Pane.
| | 06:14 | Now this is for our Home Inventory,
and you can see that this is based on the
| | 06:18 | Assets template, so I see below by
default couple of different forms, like
| | 06:23 | Home Inventory list.
| | 06:25 | That's the form I'm looking at right
now over here on the right, but if I
| | 06:28 | want to look at a different kind of form,
Asset Details, I could double-click right here.
| | 06:33 | This opens up the Asset Details form.
| | 06:35 | It's the same information that I can look at
or enter, but it's a different way of doing it.
| | 06:41 | You can see down at the bottom here on
that record 1 of 5 and I can move through
| | 06:45 | the various records.
| | 06:46 | I can move to the end, or to the
beginning, and if I want to input a new record
| | 06:51 | there's a button for that as well.
| | 06:53 | I'm going to close this up for now.
| | 06:54 | I can click the Close button up here or
choose Close right down here, and it's
| | 06:58 | always available to me in the Navigation Pane.
| | 07:01 | The Navigation Pane's going to allow me
to move quickly and easily through the
| | 07:04 | various objects in my database.
| | 07:06 | So when we have multiple tables and
different forms, and we have all kinds
| | 07:09 | of queries and reports, a quick way to get
around them is using this Navigation Pane.
| | 07:15 | Now, if you look down below,
these icons are little bit different.
| | 07:17 | These little green ones represent reports.
| | 07:20 | So if I want to look at my Assets by
Category, I could double-click here,
| | 07:24 | it opens up a report for me showing
the graphical representation as well as
| | 07:29 | the details down below.
| | 07:31 | Another thing happened here as well.
| | 07:33 | The Assets by Category tab just showed up.
| | 07:36 | So another way to close up something
you've opened up is to right-click its tab
| | 07:40 | and choose Close from here.
| | 07:41 | All right, same goes for these other
reports like Asset Details, Assets by
| | 07:47 | Location, double-clicking will launch it.
| | 07:49 | It gives you a tab so you can move
quickly and easily between the various
| | 07:53 | objects, and when you're done you
can either click the Close button or
| | 07:57 | right-click and choose Close.
| | 07:59 | Now you'll notice that we've got the
Assets section here showing us different
| | 08:04 | reports and forms, but we've
also got Supporting Objects.
| | 08:07 | So what's in behind the scenes
allowing us to use these forms and reports?
| | 08:12 | Well if we click this little drop down here
we'll expand this section to show a table.
| | 08:17 | There's an Assets table.
| | 08:18 | Now if I double-click that you can see
now we're looking at the actual table
| | 08:22 | where this information is
either entered or comes from.
| | 08:25 | And again we've got a tab.
| | 08:27 | I can right-click and close that when I'm
done, and I've got two more forms down here.
| | 08:31 | If I want to work with the Assets by
Categories or by location, I can do that to.
| | 08:36 | I can change the names of these
obviously to my Inventory by Categories or
| | 08:40 | Inventory by Location Chart.
| | 08:42 | We're going to talk about working
with forms and reports and tables and
| | 08:46 | everything in upcoming lessons.
| | 08:48 | So right now I just want you to get
familiar with the Navigation Pane;
| | 08:51 | how to use it, when we're done looking
at a section we can collapse it like so.
| | 08:55 | When we're done with the Navigation
Pane, we can minimize it or close it up
| | 08:59 | right here and you'll see that it's
always available to us down the left-hand
| | 09:03 | side, and we're going to get into
greater detail with the Navigation Pane later
| | 09:07 | on when we start using it, and using it
to navigate through the various tables
| | 09:11 | and forms and reports.
| | 09:12 | There are different ways to
sort what you see there as well.
| | 09:16 | But hopefully this gives you a nice overview
of the new work environment using Access 2007.
| | 09:21 | Keep in mind the ribbon gives you
the tools you need when you need them.
| | 09:24 | It's context-sensitive and the
Navigation Pane is always at your fingertips down
| | 09:28 | the left-hand side here, to make it
easy for you to go between the objects in
| | 09:32 | your database, like
tables and forms and reports.
| | Collapse this transcript |
| Customizing the Access environment| 00:00 | I promise you we're very close now to
actually designing your own database
| | 00:04 | and creating the objects in that
database, like tables and forms, queries and
| | 00:08 | reports, but just before we do I want to
bring your attention to the Access Options.
| | 00:14 | You have full control over how your
Microsoft Access application works, and
| | 00:19 | you can access those options by going
up to the top left corner and clicking
| | 00:22 | the Office button and coming down to the
very bottom, where you'll find Access Options.
| | 00:27 | Give that a click.
| | 00:27 | All right, right now for
me Customize is selected.
| | 00:31 | Yours may be something else, but
click on Customize, cause under Customize
| | 00:35 | you're going to see something familiar
to you if you went through a previous
| | 00:38 | lesson where we talked
about the Quick Access toolbar.
| | 00:41 | This is the exact same information for
adding and removing and reordering the
| | 00:46 | buttons that appear on
your Quick Access toolbar.
| | 00:49 | Here are the actual commands or
buttons that now appear on my Quick Access
| | 00:52 | toolbar in this order, but if I wanted
to add any I can go to any one of these
| | 00:57 | commands, which falls under the Popular
Commands category and just simply Add,
| | 01:02 | click to Add, or with it selected, Remove.
| | 01:07 | Now if I wanted to just select from
different groups of commands, I can come
| | 01:10 | down here, or if I want to see them all,
I can choose All Commands, and I get
| | 01:15 | a full alphabetical listing of
absolutely every command that can go on my
| | 01:19 | Quick Access toolbar.
| | 01:21 | But we covered this already in a
previous lesson, so we're going to move on, and
| | 01:25 | we're going to start at the top
here of our list under Popular.
| | 01:28 | As soon as we click Popular, you can
see here's where we go to change the most
| | 01:31 | popular options in Access.
| | 01:33 | For example ClearType.
| | 01:35 | ClearType is an option that smoothes
out fonts and makes them look sharper and
| | 01:40 | crisper on our screen.
| | 01:41 | It takes a little more resources
out of your computer so with it always
| | 01:45 | turned on like this, you know you can
speed up performance if you wanted to
| | 01:48 | buy deselecting it.
| | 01:49 | So any of these options can be turned
on or off including the color scheme and
| | 01:54 | ScreenTips for example.
| | 01:56 | When we're creating databases you can
see the default file format, and this is
| | 01:59 | an important one, is set
to Access 2007 by default.
| | 02:03 | This is a new format that users of
previous versions of Access will not be able
| | 02:08 | to open up your files,
unless they have Access 2007.
| | 02:11 | So if you do share with others you
may want to change your default to
| | 02:15 | something else like Access 2002, 2003 for
example, or even go all the way back to Access 2000.
| | 02:21 | I'm going to leave it at 2007, and I
know that this format's fine for me
| | 02:26 | because I won't be sharing, at least I
won't be sharing with anyone who's got
| | 02:30 | an older version of Access.
| | 02:31 | The default database folder where my
database files are stored is My Documents.
| | 02:36 | You can see it right here under Documents.
| | 02:38 | I can change that using the Browse button.
| | 02:40 | The New database sort order is set
to General, and there's all kinds of
| | 02:44 | languages to choose from down here,
but we'll leave it at General.
| | 02:48 | And we can also personalize our
copy of Office, of Microsoft Office.
| | 02:52 | This applies to all of the
applications in Microsoft Office, not just Access.
| | 02:56 | So the User name David Rivers, and the
initials DR will be attached to the files
| | 03:00 | I save in any of the Office applications.
| | 03:03 | All right, let's go to Current Database
and here we're going to see options for
| | 03:08 | the current database, that's the one I
have open right now, which is my personal
| | 03:11 | inventory database, and you can see
the display form that comes up is my home
| | 03:15 | inventory list by default.
| | 03:17 | The status bar is displayed.
| | 03:18 | There's all kinds of options
for working with this database.
| | 03:21 | There's a Navigation section.
| | 03:23 | The Navigation Pane is
enabled, so I can see it here.
| | 03:26 | The Ribbon is also enabled.
| | 03:29 | AutoCorrect options for
name tracking in there as well.
| | 03:33 | We won't go into detail on every single
option, but just so you know where to go
| | 03:36 | to make those changes.
| | 03:38 | I'll go to Datasheet now.
| | 03:39 | Customize the way datasheets look in
Access by changing their font colors,
| | 03:43 | background colors, gridlines.
| | 03:45 | You can see cell effects down here.
| | 03:47 | The default font that I'm using is
this one, Calibri, it's at size 11 points,
| | 03:52 | but I can change that if I wanted to.
| | 03:55 | Even the appearance using
underlining and italics.
| | 03:58 | I'm not going to make any changes here.
| | 04:00 | I'm going to move on to Object Designers.
| | 04:02 | So in Table design, Query design, and
Forms design you can see, we've also got
| | 04:07 | down at the bottom Error checking, all
kinds of options to work with when we're
| | 04:11 | designing any of these items.
| | 04:14 | The one that's important that I want to
draw your attention to is under Table design.
| | 04:18 | The default field unless we choose
something different is a text field
| | 04:22 | containing 255 characters max.
| | 04:26 | So we could change that if we use a
lot a numeric fields, for example.
| | 04:29 | You could change it to Number, but you
can see there's all kinds of different
| | 04:33 | field types to choose from, but if the
most common one's going to be text I'm
| | 04:37 | going to leave it at Text.
| | 04:39 | We've also got some Proofing options.
| | 04:40 | This is important, especially AutoCorrect
options, if you like them or don't like them.
| | 04:45 | There are some that I like and don't
like and this is where I go to turn them
| | 04:49 | on or turn them off.
| | 04:50 | Ignore words in uppercase is turned on
and Ignore words that contain numbers is
| | 04:55 | important when working with a
database because you may have fields that are
| | 04:59 | combinations of characters and numbers.
| | 05:01 | We don't want them automatically
corrected or to appear as spelling mistakes.
| | 05:05 | We're ignoring Internet
and file addresses as well.
| | 05:08 | So obviously www.Lynda.com is not in
any dictionary, but it appears like an
| | 05:14 | Internet address, so it won't
show up as a spelling mistake.
| | 05:17 | Flag repeated words is turned
on, that's kind of important.
| | 05:21 | Under the AutoCorrect Options, you can
click here to get a whole bunch more and
| | 05:26 | you can turn any of those off that
annoy you by clicking this button.
| | 05:29 | For example two initial capitals,
capitalize names of days is turned on, if you
| | 05:35 | don't like that, correct accidental
use of caps lock key, I do like that one,
| | 05:39 | and you can see down below a whole
list of items that will be replaced with
| | 05:44 | something different.
| | 05:46 | So of course you can add to this and you
can turn off or remove any of these as well.
| | 05:52 | So this all applies to any of the
applications in the Office Suite, not just Access.
| | 05:56 | Any changes you make are
carried through the entire Suite.
| | 05:59 | There is an Advanced section, and you
can see we've got some Editing options
| | 06:05 | that can be turned on and off,
Display, Printing look at the margins for
| | 06:10 | printing if you don't like
those you can change them.
| | 06:13 | So I encourage you to go through all
of these categories and see if there are
| | 06:16 | things that you tend to get annoyed by
and turn them off or if there are things
| | 06:20 | you feel are missing, turn them on.
| | 06:22 | There's an Add-ins, a Trust
Center and, a Resources tab as well.
| | 06:27 | So I'm going to click Cancel down below.
| | 06:29 | I haven't made any changes.
| | 06:30 | I don't want to make any changes.
| | 06:32 | I'm going to accept the defaults as we
go through this title but it was very
| | 06:35 | important for me to let you know that
from the Office button you can access the
| | 06:40 | Microsoft Access options by clicking
this button to change any of your work
| | 06:44 | environment settings.
| | Collapse this transcript |
|
|
2. Creating Databases and TablesPlanning and designing databases| 00:00 | All right gang, it's design time.
| | 00:02 | It's time for us to
design our relational database.
| | 00:06 | Like I mentioned in a previous lesson,
up to 70% of the effort that goes into
| | 00:11 | designing and creating a relational
database in Microsoft Access happens before
| | 00:16 | you even get into the software.
| | 00:17 | So literally on paper you want to
figure out what goes into this database.
| | 00:22 | Why am I creating it?
| | 00:23 | What's the reason and
what's going to be the outcome?
| | 00:26 | So normally people don't just sit down
when they're bored and say hey, I think
| | 00:30 | I'll create a relational database today.
| | 00:32 | Usually there's a reason.
| | 00:33 | There's something that needs to be
accomplished, maybe an issue that needs to be resolved.
| | 00:38 | Using our real-life scenario, we
need to identify the issue of having a
| | 00:42 | disorganized music collection.
| | 00:45 | So what we have is hundreds of albums,
some of them are in vinyl, we've got a
| | 00:49 | bunch on tape, a whole bunch on
CD, and there's no order to them.
| | 00:53 | They're disorganized stored in various
places, on racks, in boxes, and what we
| | 00:58 | need to be able to do is find a specific
album quickly and right now it's taking
| | 01:02 | too long searching through all these things.
| | 01:04 | It takes forever for us to find a specific
song that might be on one of those albums.
| | 01:09 | And other things that we'd like to be
able to accomplish might be let's say
| | 01:12 | someone wants to find all
the songs by a specific artist.
| | 01:15 | Maybe it's all the songs in
a time period, or by genre.
| | 01:19 | Maybe you're having a dinner party and you want
to bring out a bunch of jazz music for example.
| | 01:23 | Well you want to be able to go through
your collection and find it, and then
| | 01:27 | have it ready to go during that dinner party.
| | 01:30 | What else we'd like to be able to do is
to easily add new albums as they come in.
| | 01:35 | So when we get a new CD for example,
we want to be ale to pop this in
| | 01:39 | easily, fast into our new database so that
it's there the next time we need to access it.
| | 01:46 | Now using this scenario, you can take
any scenario out there, whether it's
| | 01:50 | personal or professional.
| | 01:52 | Take for example a person who has a
medical practice, they would use a database
| | 01:57 | to keep track of their patients for
example., and in their patient records would
| | 02:02 | be all kinds of information that
gets stored with those patients.
| | 02:06 | Or maybe you're running a business where
you're selling goods and you've got an inventory.
| | 02:10 | You'll want to do the exact same
thing that we're doing here organizing our
| | 02:14 | music collection, except you'll be
organizing different items in an inventory.
| | 02:19 | So once we've decided what the issue
is and what we want to resolve here, the
| | 02:24 | next step is actually identify what
the fields are going to be, the pieces of
| | 02:29 | information we want stored about each album
in our case, each song, each artist, and so on.
| | 02:35 | We're going to look at that next.
| | Collapse this transcript |
| Working with fields| 00:00 | So we've now determined
what the issue is we've got:
| | 00:03 | our disorganized
collection of music information.
| | 00:06 | It's in different
locations, in boxes and on racks.
| | 00:09 | It's in different media, it's on CDs,
some on vinyls, some are on tapes.
| | 00:15 | We've got it all scattered
around and very disorganized.
| | 00:17 | When we go to find a specific artist
or a specific type of music it's very
| | 00:22 | difficult to round it all up.
| | 00:24 | So we've decided we're going to create
a relational database that's going to
| | 00:27 | contain all of our music in a library,
make it easy for us to find specific
| | 00:32 | pieces of information, such as if we
have a party that's got an 80's theme for
| | 00:37 | example, we want to be able to
round up all of our 80s music.
| | 00:41 | Well to do that we need to figure out
now what fields we need to create in what
| | 00:46 | tables, so that we can get the
information in first of all, that's called data
| | 00:51 | entry, but then make it easy
to pull that information out.
| | 00:55 | So let's determine the Fields
now that belong in our database.
| | 00:59 | In our music library we know that all
of our albums have titles, so there's
| | 01:03 | going to be an album title.
| | 01:05 | We also know that each of
the albums has an artist.
| | 01:08 | Now some of the albums may have
various artists, so the Artist field in the
| | 01:12 | Album table might be able to
include an actual name of an artist or it
| | 01:16 | might just be various.
| | 01:17 | Keep that in mind when we talk about songs.
| | 01:20 | We'd like to be able to track the year
that the album was created, even the decade.
| | 01:25 | That's handy because if it was done in
82 and another CD that we have was done
| | 01:30 | in 89 and we want to be able to pull
out all the 80s music, we want to be able
| | 01:34 | to get a nice report on all of the
albums that were done in the 80s.
| | 01:39 | The media, in other words is it on
CD, is it on vinyl, is it on tape.
| | 01:43 | And why is that handy?
| | 01:44 | Well maybe we're asked how
many songs do you have on vinyl?
| | 01:48 | How many albums do you have that are on CD?
| | 01:51 | It would be easy to pull up that information.
| | 01:53 | How about the location? Is it on a rack?
| | 01:56 | Is it in a box?
| | 01:57 | When we use a Location field, we'll be
able to find our CDs, our vinyl records,
| | 02:02 | our tapes quickly and easily.
| | 02:04 | Of course there's going to be some
manual work on the other side of our
| | 02:07 | database, which is to actually mark up the
racks and the boxes and label them properly.
| | 02:12 | How about Genre?
| | 02:14 | We want to be able to find all the
jazz music that we have, all of the rock
| | 02:18 | music, the songs themselves, we need
to be able to the narrow it down to a
| | 02:23 | specific song, if we want.
| | 02:24 | Give me all the songs by
the group Boston, for example.
| | 02:28 | So that means that we're going to have
some other information that's pertaining
| | 02:32 | to an album, the actual songs on that album.
| | 02:35 | How about the condition?
| | 02:37 | That might be important.
| | 02:38 | Is it in good condition?
| | 02:40 | Is it in bad condition?
| | 02:41 | We might want to be able to track that.
| | 02:43 | As well as a rating, maybe we want
to be able to give three stars to our
| | 02:47 | favorites, one star to our least favorites
and maybe two stars for right in the middle.
| | 02:52 | We don't care either way.
| | 02:54 | So these are the fields, and right now
they're just scattered about still very
| | 02:57 | disorganized, but we've got a good
handle now on what we need to track.
| | 03:01 | Now keep in mind this is not etched in stone.
| | 03:04 | When we create our tables using these
fields, and we realize a little bit later
| | 03:08 | on, hey we're missing some information here.
| | 03:10 | It's easy to add a field to a table later on.
| | 03:13 | We'll look at that when we get to modifying
your table design after it's been created.
| | 03:18 | But we still do need to get organized.
| | 03:20 | We need to take these pieces of
information that we're going to be tracking, the
| | 03:24 | various fields here, and put them into
the separate tables that are going make
| | 03:28 | it nice and organized for us, and of
course remembering the three normal forms
| | 03:32 | that we talked about.
| | 03:34 | We want to keep normalization in mind too.
| | 03:37 | So when we get organized, we see that
we might have five different tables, an
| | 03:42 | Album table, a table with just songs
in it, another one with the various
| | 03:46 | locations, another one for the
genre and another one for the media.
| | 03:53 | So in the Album table, for example
we'd see things like the album title, the
| | 03:56 | artist, the year that the album came out,
the decade, as well would be good in there.
| | 04:01 | Our rating system would be good.
| | 04:03 | It relates to the album
itself as does the condition.
| | 04:07 | Now in the Songs table, each of the
song titles from an album will show up in
| | 04:11 | the Songs table, as well as the artist.
| | 04:13 | Now you'll notice we've got Artist here twice.
| | 04:15 | We've got it in the Album
table and in the Songs table.
| | 04:18 | Remember that we could have CDs or
records or tapes that have various artists.
| | 04:24 | So the album title might be Sound
Explosion, the artist in the Album table would
| | 04:29 | be various and then the individual songs
in the Songs table would have their own
| | 04:33 | actual artist singing that song.
| | 04:36 | The Locations table will have at
least one field for the location.
| | 04:40 | Of course we're going to need
additional fields in each of these tables when we
| | 04:43 | start to talk about joining them
together or relating them. The Genres.
| | 04:48 | We'll have a genre field in there and
the media as well will be kept separate.
| | 04:53 | We can join these all together into one
big happy family when we start talking
| | 04:58 | about the primary and
foreign keys a little bit later on.
| | 05:02 | So we've kind of narrowed it down to
the fields we want and now we've organized
| | 05:07 | it into the various tables.
| | 05:09 | We're still working on paper here.
| | 05:11 | The very next step now is going
to be talking about those keys:
| | 05:14 | the primary and the foreign keys.
| | 05:16 | So which is the field that will
be considered the primary key?
| | 05:20 | Is it there already, or
do we need to add a field?
| | 05:23 | And then in the related table, the
foreign key that matches up the two tables.
| | 05:27 | So that's what we're going to talk about next.
| | Collapse this transcript |
| Choosing keys| 00:00 | As we get closer now to creating and
defining the actual tables that will appear
| | 00:05 | in our relational database, along with
actual fields that will appear in each of
| | 00:09 | those tables, we need to think back
now to a topic we discussed in a previous
| | 00:14 | lesson, and that's normalization.
| | 00:16 | So we've broken down the fields into
their smallest forms, we've separated them
| | 00:20 | into tables to avoid redundancies,
and now we need to think about how we're
| | 00:24 | going to relate these tables one to another.
| | 00:27 | As you recall, we talked about
primary keys and foreign keys.
| | 00:32 | So if we look over here at the very
far left of our Album table, we need a
| | 00:36 | field in here that will uniquely identify
our albums, so maybe an Album ID for example.
| | 00:43 | And then to relate the albums to the
songs, we might need to see that Album ID
| | 00:48 | somewhere in the Songs table.
| | 00:50 | That becomes the foreign key, and as
we think about it, we've got Locations,
| | 00:54 | we've got Genres, and we've got Media.
| | 00:57 | Well as I think about the various
albums, they can only be stored in
| | 01:00 | one location at a time.
| | 01:02 | So maybe we don't need a Locations
table and the Location field can go back
| | 01:06 | in the Album table.
| | 01:08 | Same thing for Media.
| | 01:09 | Genre really applies to the various
songs, so maybe that field belongs in the
| | 01:13 | Songs table, but we're missing something here.
| | 01:16 | We notice that we've got the Artist
field here in the Album table, and we've got
| | 01:21 | the Artist field here in the Songs table.
| | 01:23 | Think about and album that
has various artists on it.
| | 01:26 | The answer in this field will be
various, while over here for the specific
| | 01:31 | songs, it will have actual performers.
| | 01:33 | So we can't have the same
field here named the same thing.
| | 01:37 | We'll change that to Performer and
then we might need a table listing all of
| | 01:42 | our performers that will be linked to
the Songs table, and that's how I came up
| | 01:45 | with this next image.
| | 01:47 | Here you can see we've got our Album
with the Album ID in bold with the asterix
| | 01:52 | indicating this is our primary key.
| | 01:54 | So we'll never have duplicate albums showing up.
| | 01:57 | This is the unique
identifier for each of our albums:
| | 02:00 | the title, the artist, again that could
be various or it could be a group or it
| | 02:05 | could be an individual.
| | 02:06 | We're going to rate these:
| | 02:07 | the condition it's in, where it's
located and what type of media it's on.
| | 02:13 | As we go over to the Songs table now you
see we've got a Song Title, and instead
| | 02:17 | of a Performer we've got a Performer ID,
because we've now got this Performers
| | 02:21 | table, which will have a Performer ID.
| | 02:23 | each performer will have a First Name and a
Last Name and an ID or a unique identifier.
| | 02:28 | That's the primary key in this table.
| | 02:30 | So you can see that it shows up over here
in the Songs table, as does the Album ID.
| | 02:35 | So from here over to here we've got a
connection and it looks kind of like this:
| | 02:40 | one unique identifier in the Album
table and this album may appear many times
| | 02:45 | in the Songs table.
| | 02:47 | And then we've got the same thing
going from Performers ID over to our Songs
| | 02:51 | table, and again that's a
one-to-many relationship.
| | 02:55 | Each of the songs now will have a genre,
and a year, and a decade, and then all
| | 03:00 | of this information is linked together
as if it were in one big table but it's
| | 03:05 | very easy to manipulate having separated it out.
| | 03:09 | So now we've got what looks
like could be our final product.
| | 03:12 | Keep in mind we can tweak this again,
once we get into Microsoft Access and
| | 03:17 | start building our tables
and inserting our fields.
| | 03:20 | Filling those records up with actual data
we may decide we're missing some information.
| | 03:25 | Yes, we can modify the database
design at any time and we will do that a
| | 03:30 | little bit later on.
| | 03:31 | But next, it's time to get into
Microsoft Access, start creating our tables and
| | 03:36 | our fields, and inputting data into our records.
| | Collapse this transcript |
| Creating tables| 00:00 | Foundation of any database is the data itself.
| | 00:04 | Data is stored in tables.
| | 00:06 | So you can't have a database in Microsoft
Access without having at least one table.
| | 00:11 | We've already gone through the design
process and figured out what tables we're
| | 00:15 | going to need and what fields we're
going to need in each of those tables.
| | 00:18 | So now it's time to get in, create our
database, and create our first table.
| | 00:23 | Now the very first time you launch
Microsoft Access, you get the Getting Started
| | 00:27 | screen that we talked about earlier.
| | 00:29 | And you can see I can create a Blank
Database right from this icon here.
| | 00:34 | Now another option if you're not
looking at the Getting Started screen right
| | 00:37 | now is to go up to the Office button and click
New and that will accomplish the exact same thing.
| | 00:42 | You'll create a new blank database
from scratch, and as you create your first
| | 00:47 | database, the first table in that database
is automatically started for you as well.
| | 00:53 | Now, of course you can if you wanted
to start a database from a template.
| | 00:58 | So when we get into the Getting Started
screen here, we're automatically looking
| | 01:02 | at the Featured Online Templates
below our New Blank Database icon.
| | 01:06 | And if we want to look at our local
templates, we can do that by clicking Local,
| | 01:09 | and you can see we've got different
templates for Assets, one for Contacts,
| | 01:15 | Events, Faculty, and so on.
| | 01:17 | Now, each of these templates is not
just a simple database with one table.
| | 01:21 | There may be many tables, there may be some
reports built-in, and even some sample forms.
| | 01:26 | So if you wanted to get a great head
start on creating a project like we're
| | 01:30 | going to do with our music library,
Assets would probably be the one to start with.
| | 01:35 | But then you'd have to go in, and
you'd have to tweak each of those tables to
| | 01:39 | have the fields you need for your music library.
| | 01:42 | So what we're going to do is actually
just creating new blank database from
| | 01:46 | scratch by going up to the
Office button and selecting New.
| | 01:49 | Now, as soon as we do that, you
can see we are back to the original
| | 01:53 | Getting Started screen.
| | 01:54 | But over here on the right-hand
side, we have Blank Database.
| | 01:58 | Here's where we go to create a
Microsoft Office Access database that does not
| | 02:01 | contain any existing data or objects.
| | 02:04 | Remember, objects are reports,
forms, tables, and so on.
| | 02:09 | You can see by default it's going to
be called Database1, and you can see
| | 02:14 | exactly where it's going to be
saved in the Documents folder.
| | 02:17 | So that's my default.
| | 02:19 | Of course, if I want to change the
location, I could, by clicking the little
| | 02:22 | Folder icon over here, and browsing to a
location where I want to save this new database.
| | 02:29 | I'm going to click Cancel, and just
leave it as my Documents folder here.
| | 02:35 | The name, I'm going to change from
Database1 to something more meaningful.
| | 02:38 | So I'm going to highlight Database1, and
I'm going to type-in Music Library like so.
| | 02:46 | Now when I click Create, I'm
going to create my first database.
| | 02:50 | You can see all there is, is
one table in here that's started.
| | 02:53 | There aren't any fields actually except
for this ID field and it's now time for
| | 02:58 | me to look back at my design documents
and figure out what fields need to go
| | 03:02 | into this very first table, and of
course, I'll give this table a name.
| | 03:07 | That's what we're going to do next.
| | Collapse this transcript |
| Creating fields| 00:00 | In previous lesson, we created a new
blank database, and that's why we have the
| | 00:04 | screen that we see here in front of us.
| | 00:06 | If you're jumping into this lesson,
you might want to go back to the previous
| | 00:09 | lesson and just get caught up with us here.
| | 00:11 | It's very quick and easy.
| | 00:12 | When we create a new blank database
something different in Access happens that
| | 00:17 | you might not be used to
when using other applications.
| | 00:20 | We had to give our database a
name before we actually create it.
| | 00:23 | So we see that name up here;
| | 00:25 | it's Music Library, and that's on the
title bar and the other thing we did by
| | 00:29 | default was accepted the brand-new format,
which is Access 2007 database format.
| | 00:34 | Now keep in mind that this format is
not compatible with previous versions of
| | 00:38 | Access, but we were feeling safe with
that and we accepted the default format.
| | 00:42 | Another thing that happened by default
is a brand-new table is created for us.
| | 00:48 | By default it's named Table 1 until we
save it, give it a new name, and you can
| | 00:52 | see it's waiting for us here
to add new fields to this table.
| | 00:57 | So we obviously can't have a database
without having a table and some data in
| | 01:01 | it and that's why this happens by default
when we launch a brand-new blank database.
| | 01:06 | One other thing happened up here on the
ribbon you might have noticed is we've
| | 01:09 | got a new tab, and it's called Datasheet.
| | 01:11 | You see Table Tools shows up just
above it, and we've got a number of
| | 01:15 | table tools or related commands to
working with tables, because that's
| | 01:19 | what we're doing right now;
| | 01:20 | creating a brand-new table.
| | 01:22 | We've got the Views button, Fields & Columns.
| | 01:25 | There's commands related to working
with fields and the columns in our table.
| | 01:29 | We've got another section here for
choosing data types and formatting our fields.
| | 01:34 | We're going to get into that shortly.
| | 01:35 | We even have a Relationship section
that we're going to talk about a little bit
| | 01:38 | later on in this title.
| | 01:40 | So right now let's get back to
creating our brand-new table.
| | 01:43 | Of course we're going to go back to
our design process that we did on paper.
| | 01:47 | Take a look at the tables we need,
create our first table, and select the fields
| | 01:52 | that are going to go in here.
| | 01:53 | Well you can see it says Add New Field
and right now it's waiting for actual data.
| | 01:57 | So if we wanted to rename this actual
field from Add New Field to something
| | 02:01 | different, it's pretty easy.
| | 02:03 | We just right-click up here
and we go down to Rename Column.
| | 02:06 | So our first column we
actually want to call the Album Title.
| | 02:11 | I'm going to type in Album Title,
and when I hit Enter, you can see
| | 02:17 | automatically a new column is created
for me where I can insert another new
| | 02:21 | column name, and this is the field,
so we're going to go down to Artist.
| | 02:25 | This is all from our
paper design. The next one:
| | 02:29 | Rating.
| | 02:29 | And we're going to put in Condition.
| | 02:34 | The Location of the album.
| | 02:37 | Each time I'm pressing
Enter to move on to the next.
| | 02:40 | And the Media that it's stored on.
| | 02:42 | Okay, so we don't need this extra column,
so when I hit Enter it's waiting for
| | 02:46 | me to type in a name, but I don't need that.
| | 02:48 | Over here where it says ID I'm
going to right-click, and I'm going to
| | 02:52 | rename this column.
| | 02:54 | I'm just going to add a little bit to it.
| | 02:55 | This going to be our Album ID, and
I'm going to hit Enter. So there we go.
| | 03:03 | Now it's waiting for us to
actually enter some data.
| | 03:07 | So a new Album ID, the Title, Artist, etc
., but before I start doing that I want
| | 03:12 | to think about what's going in to
each of these fields and you can see by
| | 03:16 | default, if I look up here under
DataType & Formatting, and with my Album ID
| | 03:21 | highlighted, the Data Type by
default is set to AutoNumber.
| | 03:25 | So if I want the numbers to show up
here automatically as I add new albums just
| | 03:29 | to number them for me, I know that
I'm not going to get any duplicates.
| | 03:33 | So every Album ID is going to be unique,
which is what I need, and then I can
| | 03:37 | just start entering the rest of the data
without worrying about choosing numbers
| | 03:41 | to show up for my ID.
| | 03:43 | I'm going to leave it at AutoNumber.
| | 03:45 | Take a look at some of the
other options it could be:
| | 03:47 | Text and Memo fields, which allows me
to put in more text than a text field, it
| | 03:53 | could be numeric, where I could enter numbers.
| | 03:56 | Keep in mind when you put in numbers,
they're usually numbers that you're going
| | 03:59 | to use in a calculation as opposed to
things like phone numbers or ID numbers.
| | 04:04 | It could be dates and times.
| | 04:06 | It could be money, currency.
| | 04:08 | It could be a logical field,
which is a yes or a no.
| | 04:10 | It could be a Hyperlink.
| | 04:12 | So we're going to leave it at AutoNumber
and the other thing that's important is
| | 04:15 | that because it's going to be our
primary key it has to be unique.
| | 04:19 | We want this checked off over here,
which is the Unique box. Is it required?
| | 04:24 | Well yes it is, but we don't need to
check that off because it's a primary key.
| | 04:27 | So every one of our records is
going to have something in that field.
| | 04:31 | The other formatting buttons relate
to the actual numbers that might go in
| | 04:35 | there, but we're going to leave it just as is.
| | 04:37 | It's now time to see this, you know we
haven't entered any records, you might be
| | 04:41 | a good idea to save what we've done so far.
| | 04:43 | I'm going to go up to my Quick Access
tool, that's short for going to the Office
| | 04:47 | button, and choosing Save from there,
and I'm going to click the Save button and
| | 04:50 | you can see by default the name Table
1 does show up, but of course I want to
| | 04:54 | call this something different.
| | 04:55 | This is my Album table.
| | 04:57 | And when I click OK or press Enter, I
now have a brand-new table called Album.
| | 05:03 | I see it over here in the list of all my tables.
| | 05:06 | There's just the one right now and
I'm ready to start inputting data.
| | 05:10 | So our very first step is complete.
| | 05:12 | We've created our brand-new table and
now we've entered each of the fields
| | 05:16 | that will appear in this table,
we've chosen our primary key, we've even
| | 05:20 | chosen some formatting, we can go through the
rest of these fields deciding on their formatting.
| | 05:25 | Look what happens when I
click on each of these columns.
| | 05:27 | You can see the default Data
Type that is assigned to them.
| | 05:30 | The Album Title is by default a text field.
| | 05:33 | It's not going to be unique, but it is
required so I'm going to check this box.
| | 05:38 | The Artist is also text, should be required.
| | 05:42 | A Rating is by default text, and you
can see, I'm going to click the drop-down
| | 05:47 | here and I'm going to change that to a number.
| | 05:49 | So I'm going to have a number rating,
and I'm not going to do anything
| | 05:53 | else, it's not unique.
| | 05:54 | It's not required but it
is going to be a number.
| | 05:57 | The Condition, text field.
| | 06:01 | Location, Media, and of course we
don't need any more fields other than that.
| | 06:07 | So I think we've got everything set up.
| | 06:09 | Again another Save.
| | 06:10 | It's going to save or update
our changes if we've made any.
| | 06:14 | Notice that only the first time are we
prompted for the name of the table, from
| | 06:17 | then on we're just updating the existing table.
| | 06:20 | So we're ready now to start inputting
some actual data, that is entering data
| | 06:25 | into each of these fields.
| | 06:26 | We're going to do that next.
| | Collapse this transcript |
| Working with records| 00:00 | Data entry can be very tedious.
| | 00:02 | It's simply putting data into the
fields that we've created in this table.
| | 00:06 | Now without data, obviously we
don't have a database, so it's extremely
| | 00:10 | important even though it
can be very mind-numbing.
| | 00:13 | What we're going to do
here is create some records.
| | 00:15 | Every time we enter information into a
row in this particular view called the
| | 00:20 | datasheet view we're creating a record.
| | 00:22 | Now you can see right now that the Album ID
is the currently selected column or field.
| | 00:28 | I'm going to ensure that I'm
clicking on the Datasheet tab up here.
| | 00:31 | I want everyone to see the Datasheet
options on the ribbon, and we know that the
| | 00:35 | Album ID is automatically going to be
numbered for us because the Data Type up
| | 00:39 | here shows up as AutoNumber.
| | 00:41 | So all I need to do is just tab across
like I would a table in Microsoft Word or
| | 00:46 | the cells in an Excel spreadsheet enter my data.
| | 00:49 | So I'm going to tab over to the Album Title.
| | 00:52 | Now this is currently a new record
until I type my first character here.
| | 00:56 | Watch what happens.
| | 00:57 | I'm going to type in Boston.
| | 00:58 | As soon as I do, this Album ID number
shows up, number 1, and the new record now
| | 01:04 | is bumped down below.
| | 01:06 | I'm going to hit my Tab
key to move over to Artist.
| | 01:08 | This is a self-titled album,
so Boston is also the artist.
| | 01:12 | It's one of my faves.
| | 01:14 | I'm not going to give it a five star
rating, but I'm going to put a four in there.
| | 01:17 | This is on vinyl, and the condition is good.
| | 01:20 | It could be better, but it's good.
| | 01:22 | It's located on Rack 2.
| | 01:25 | So I've got a few racks and
this is on rack number two.
| | 01:28 | The Media, as I mentioned is a vinyl,
so I'm going to type that in and when I
| | 01:33 | hit Tab look what happens.
| | 01:34 | It moves down to the next record,
the next row waiting to automatically
| | 01:38 | number my next record.
| | 01:40 | So all I do is hit Tab to
move on to the next one.
| | 01:42 | So this one's called Rock Classics.
| | 01:46 | Same thing happens, a new record is pushed
down below, and this becomes record number 2.
| | 01:51 | The Artist on this one is various.
| | 01:54 | This rating is going to be a 3.
| | 01:56 | The condition is excellent. Why?
| | 01:59 | Because it's on CD.
| | 02:00 | And that's on Rack 1.
| | 02:04 | And I'm going to hit Tab and look what happens.
| | 02:06 | Each time I hit Tab I'm creating new records.
| | 02:09 | Let's just do another one.
| | 02:11 | This one's called Live! Live!
| | 02:15 | with an exclamation mark. Live!
| | 02:16 | Now you can see that this is taking up
more space than I have in this column.
| | 02:21 | We're going to talk about
formatting your fields a little bit later on.
| | 02:26 | This one's by Bryan Adams. I love this one.
| | 02:31 | I'm going to put it in as a 5.
| | 02:32 | Unfortunately, the condition is poor
because it's on a tape, which is on Rack number 3.
| | 02:40 | And I'm done, so I've
entered my first three records.
| | 02:43 | Now as I enter those records and as I
Tab from field to field they're actually
| | 02:47 | being saved in the table.
| | 02:49 | Yes, I can go up and save at any
time, but just so you know records are
| | 02:52 | being saved on the fly.
| | 02:54 | Let's add one more just for fun, so we
have something to edit a little bit later on.
| | 03:01 | Tuesday Night Music Club.
| | 03:07 | This one's by Sheryl Crow.
| | 03:10 | Rating, I'm going to put it at a 4.
| | 03:13 | Excellent condition. This is a CD.
| | 03:19 | I put it on Rack 3. The type is CD.
| | 03:22 | Excellent.
| | 03:23 | I hit Tab to lock in that new record.
| | 03:25 | All right so what happens if we
need to go back and make a change?
| | 03:29 | I just noticed I put that on the wrong rack.
| | 03:32 | All my CDs are on rack number one.
| | 03:34 | So I'm going to come up in here and I
can just with my mouse click inside any of
| | 03:37 | these fields and edit.
| | 03:38 | So I'm going to take that 3 out and put in a 1.
| | 03:42 | As I hit Tab, you can see I'm moving
through the various fields in the various records.
| | 03:49 | Let's add another one.
| | 03:49 | I'm going to type in Boston, Boston.
| | 03:55 | I'm going to put in a Rating of 4. Good.
| | 03:59 | You can see what's happening here.
| | 04:01 | I don't realize, but I've
already got this one in here.
| | 04:05 | So when I hit Tab and create this new
record, I realize, hey wait a second I've
| | 04:09 | got a record in here that I don't want.
| | 04:12 | So the common mistake that people will
make, is they'll come in here and perhaps
| | 04:17 | click on the left-hand side here to
highlight the entire row and then they'll
| | 04:21 | come up here and try to hit Delete.
| | 04:23 | When really if you look at the name
of this group, it's fields and columns.
| | 04:27 | We would use this Delete
command here for deleting fields.
| | 04:30 | The actual column, not the actual records.
| | 04:33 | So look what happens when we hit
our Delete key on the keyboard.
| | 04:37 | You are about to delete 1 record, if
you click Yes, you won't be able to
| | 04:41 | undo this delete operation, so you
have to be sure that you meant to hit
| | 04:44 | Delete to delete a record.
| | 04:46 | I'm going to click Yes.
| | 04:47 | And it returns me back to
just four Album IDs now.
| | 04:51 | So editing, deleting and of course
entering records, all very important.
| | 04:56 | Data entry is vital to any database
because as you know, without the data
| | 05:01 | there is no database.
| | Collapse this transcript |
| Working with data| 00:00 | We're going to look now at formatting
data in a Microsoft Access database.
| | 00:05 | Formatting data is a little bit more
involved than just say formatting text in a
| | 00:09 | Microsoft Word document.
| | 00:10 | Yes, we can go into our table and we
can format the appearance of our data,
| | 00:15 | changing the font, the
size, bold, italics, etc..
| | 00:19 | All of the stuff we can do in Microsoft Word,
but in a database we can go a step further.
| | 00:24 | We can format fields so that only
certain kinds of data can go into them.
| | 00:28 | For example maybe in this rating field
here we only want numbers and as soon
| | 00:32 | as somebody tries to type anything but a number,
they get a dialog box that says they can't.
| | 00:37 | So that kind of data formatting is what
we're going to look at in this lesson,
| | 00:41 | plus we're going to look at a shortcut
that's going to save you some time when
| | 00:44 | it comes to your data entry.
| | 00:45 | In fact we're going to start with that.
| | 00:47 | And before we do, we're going to open
up another database that has a table with
| | 00:51 | a lot more information in it
than what we've got here so far.
| | 00:55 | So let's go up to the Office
button and we'll click on Open.
| | 01:00 | Let's navigate to the Lesson2
folder of your Exercise Files.
| | 01:04 | There's where you'll find Music Library 2.
| | 01:07 | You can double-click that or one click and
then Open will bring it up on your screen.
| | 01:11 | Now you may see this security
warning saying that certain content in the
| | 01:14 | database has been disabled.
| | 01:16 | Now this is a database that we are
creating on-the-fly so I'm not too worried
| | 01:21 | about security, but we'll click the
Options to see that there's a VBA Macro in there.
| | 01:25 | Now some people use VBA, that's Visual
Basic, to create viruses and that kind
| | 01:30 | of stuff, so we really want to be sure
that when we enable this content we're
| | 01:34 | sure that it's ours, and we are so you can
go ahead and enable the content and click OK.
| | 01:40 | So here's our Album table.
| | 01:42 | We can double-click it to open it up
and you can see it's the exact same
| | 01:45 | table that we've been working with, but we've
just got more data in here now to work with.
| | 01:50 | So that shortcut I was telling you
about comes to data entry and if you look at
| | 01:54 | the number 11 right here, which is
the Thriller album by Michael Jackson.
| | 01:57 | I have it here on tape, and I've also
got it on CD, but it's not listed here yet.
| | 02:02 | So what I'm going to do is I'm going to
select the entire record, copy and paste
| | 02:05 | it, and then just make a couple of
minor adjustments to save me some time.
| | 02:09 | To select an entire record, you come
over to the very far left, when we see the
| | 02:13 | arrow pointing right we just give
it a click to select one record.
| | 02:17 | Now if I want to select more than one
I can click and drag and you can see as
| | 02:20 | I click and drag up or down, I'm
highlighting more than one record, but for
| | 02:24 | this exercise we're going to click on just a
single record here, we want it highlighted.
| | 02:28 | Now to copy it, we go up to the Office button.
| | 02:31 | We can use the keyboard by pressing
Control and the letter C as in Copy, or
| | 02:36 | what I like to do, if I've already got my hand
on the mouse is just right-click and choose Copy.
| | 02:42 | So it's been copied.
| | 02:43 | Now I just need to paste it
where the new record goes.
| | 02:46 | That means clicking over here on the
left-hand side to highlight that entire
| | 02:49 | row, and then anywhere in the shaded
area just right-click and choose Paste.
| | 02:54 | So you can see it's automatically numbered 14.
| | 02:57 | It's not number 11.
| | 02:59 | It's still called Thriller by Michael Jackson.
| | 03:01 | It's still got the same rating.
| | 03:03 | The Condition, Rack, and
Media are going to change though.
| | 03:07 | The condition for my CD is actually Excellent;
| | 03:10 | they don't wear out.
| | 03:12 | It's on Rack 1 and tabbing over
to the next field to type in CD.
| | 03:16 | When I hit Tab I'm on to a new record again.
| | 03:19 | So that should save you some time.
| | 03:21 | If you got duplication in there,
where you've got the same album, but maybe
| | 03:24 | it's on different media or at different
locations for example, then you can use
| | 03:28 | that copy and paste.
| | 03:30 | Now how about formatting our data?
| | 03:32 | Let's talk about simple text
formatting like we're used to in Microsoft Word
| | 03:37 | or Excel for example.
| | 03:39 | If I click anywhere here in my table
and I just don't like this font that's
| | 03:43 | showing up by default and the font size.
| | 03:45 | I can come in here and change
the font by clicking the drop-down.
| | 03:48 | I'm going to choose Arial.
| | 03:50 | I like to do all of my work in Arial.
| | 03:52 | There it is and you see that the
entire table just changed to Arial.
| | 03:57 | The size, I'm going to drop it down to
10, and although I haven't selected the
| | 04:01 | entire table, all of the data in
the table is changed to Arial 10.
| | 04:06 | Obviously, if I went in here and
clicked on italics everything turns italics.
| | 04:10 | Same thing for bold, underline, etc.
| | 04:13 | So that's just simple formatting like
we're used to, and it all appears here in
| | 04:18 | the Format section on the
Ribbon here for our Datasheet.
| | 04:20 | Now what if we want to just
format what goes into a field?
| | 04:24 | Now we know that the Album ID is counted for us;
| | 04:27 | it's an automatic generator of numbers.
| | 04:30 | But the Rating over here, maybe we want
to make sure that a number goes in here,
| | 04:34 | it should be an numeric field or a
number field, and we want to make sure that
| | 04:38 | the numbers are maybe center aligned.
| | 04:41 | So what we can do is actually change our views.
| | 04:43 | Right now we're in the Datasheet view.
| | 04:44 | If we go over here to the left-hand
side and click the View drop-down, you'll
| | 04:49 | see Design View is another option, and if I
click on that, I can see each of my fields.
| | 04:54 | I can see their Data Types over here, if
I want to put in a description I could,
| | 05:00 | and you can see that this one up here
Album ID has a little key next to it
| | 05:03 | indicating it is the primary key.
| | 05:06 | It's the one record that will
always have a unique identifier.
| | 05:10 | Down below, we've also got the Field Properties.
| | 05:12 | So let's go to our Rating
right here, which is a number.
| | 05:16 | I'm going to click anywhere in
Rating, and you can see down below the
| | 05:19 | Field Properties change.
| | 05:20 | The Field Size is set to Long Integer.
| | 05:23 | If I click in here, I know
I'm only going to need 1 to 5.
| | 05:26 | I don't need a long integer.
| | 05:28 | So I could go down to Single for example.
| | 05:31 | Next, I have a Format field here.
| | 05:33 | If I click in the Format and click the
drop-down, I can see some different choices.
| | 05:38 | Well I'm definitely not going to be putting
money in there, whether it's dollars or euros.
| | 05:43 | Fixed is an option, so is Standard.
| | 05:45 | You can see Percent and
Scientific are also options in there.
| | 05:48 | So I'm going to go to
Fixed and give that a click.
| | 05:52 | Now you can see that Decimal Places is
next with a fixed format using a number.
| | 05:57 | I can choose a number of decimal places.
| | 05:59 | I click in here, and if I don't want any
decimal places, it's just going to be 1
| | 06:04 | through 5, I'm going to choose 0.
| | 06:07 | So all of this is formatting our data.
| | 06:10 | We can do a lot more than just
formatting the appearance of our data, but you
| | 06:13 | can see we're formatting the
way that data can be entered.
| | 06:17 | There are other ways to do this that
we'll look at a little bit later, a little
| | 06:20 | more advanced, using input masks and
using validation rules and so on, but for
| | 06:25 | now that's a good head
start in formatting our data.
| | 06:28 | Let's move back up to the Views
and change over to Datasheet now.
| | 06:32 | You must first save the table.
| | 06:33 | Do you want to save the table now?
| | 06:35 | So you'll notice when we were
entering records earlier, the tables
| | 06:38 | automatically saved, but here we've
made an actual design change to the table
| | 06:42 | so we should save it.
| | 06:44 | Luckily for us this little dialog box
appears if we ever try to leave the Design
| | 06:49 | View without saving our changes.
| | 06:51 | So yes we do want to save our table now,
but keep in mind you've got your Save
| | 06:54 | button up here on the Quick Access toolbar.
| | 06:57 | At any time you can save your changes.
| | 06:59 | So now we've just made it, the proper
data is going to go into the proper fields.
| | 07:04 | We've just gotten that much closer to
what we call data integrity, and that's
| | 07:08 | some simple formatting of data
in a Microsoft Access database.
| | Collapse this transcript |
| Checking spelling| 00:00 | By now you're probably realizing that
things work a little bit differently in
| | 00:04 | Microsoft Access and they do from the
other applications in the Microsoft Office
| | 00:08 | Suite, and that goes for
checking spelling and grammar as well.
| | 00:11 | If you think about Microsoft Word or
Outlook for example, spelling and grammar
| | 00:15 | can be checked on the fly.
| | 00:17 | That's why we see those red and green
squiggly lines under some of our text.
| | 00:20 | Well in Microsoft Access, there is no
grammar checker for one, and you can't
| | 00:25 | check spelling on the fly, so you'll
never see those red squiggly lines.
| | 00:29 | There is a spell checker though
that we can access whenever we want.
| | 00:32 | Of course, when we enter data into a
table in Microsoft Access, we want to make
| | 00:36 | sure it's accurate, so using the spell
checker now and then is a good idea, and
| | 00:40 | here's how you do it.
| | 00:42 | I still have the Music Library 2 open
here on my Desktop and if you don't,
| | 00:47 | you can go to the Exercise Files
into the Lesson2 folder and find Music
| | 00:51 | Library 2, open that up, and what
we're going to do is actually type in
| | 00:55 | something incorrectly here.
| | 00:57 | Record number 13 here, Grease, which is
Various artists, I'm going to take out
| | 01:01 | the u, just so I have a spelling error
in there, and you can see as I Tab along,
| | 01:05 | nothing happens to the "Various."
| | 01:07 | I don't see a red squiggly
line showing up underneath.
| | 01:10 | But as I'm entering my data,
periodically I may want to use the spell checker.
| | 01:14 | Now you'll want to make sure the Home
tab is selected, because that's where
| | 01:17 | you'll see under the Records section
Spelling, and we'll give that a click.
| | 01:21 | So right away it kicks into gear, it
gets to the word "Various" which is missing
| | 01:27 | our u, doesn't recognize it in the
dictionary, and Various with the u is
| | 01:32 | highlighted down below, so we can
choose to ignore that, change it, add it to
| | 01:38 | the dictionary, ignore all and change
all are other options, and then we've also
| | 01:42 | got AutoCorrect here.
| | 01:44 | So some of the things you may be used to
from the other applications in the Office Suite.
| | 01:47 | This is one that we do want to change,
so we'll click Change and you can see
| | 01:51 | that the spell check is
complete, so I can click OK.
| | 01:55 | It's all fixed up for me and my table
and you can see my cursor is sitting there
| | 01:59 | inside that actual field in that record.
| | 02:02 | Now let's go back to Spelling for a
second, because you may have noticed that
| | 02:06 | AutoCorrect is an option and
AutoCorrect can be turned on so that as we're
| | 02:11 | typing, things do get fixed for us on the fly.
| | 02:14 | We won't see spelling errors on the fly,
but we may want see them getting fixed.
| | 02:18 | So I'm going to go up here to the Office
button, and down to Access Options, and
| | 02:24 | over here on the left I'm going to
click on Proofing, and you can see under
| | 02:28 | AutoCorrect options we do have a button,
as well as some things are happening
| | 02:32 | automatically for us like
ignoring words in uppercase;
| | 02:35 | they won't be considered spelling mistakes.
| | 02:37 | Words containing numbers will not be
considered spelling errors as well, unless
| | 02:41 | we want to turn that off
by clicking the checkbox.
| | 02:44 | I'm going to leave it on.
| | 02:45 | Because we're working with
data, different rules apply.
| | 02:48 | We do ignore Internet and file addresses
like www.addresses or FTP addresses and so on.
| | 02:55 | We do want to flag repeated words, and
you can see we have a couple other options;
| | 02:59 | enforce accented uppercase and French,
if you are using any of the French
| | 03:02 | characters, that can be turned on or off;
| | 03:04 | and suggest from the main
dictionary only is another option.
| | 03:07 | Remember we can have many dictionaries,
custom dictionaries, installed as well.
| | 03:12 | But I want to go up to the AutoCorrect
Options here, and show you some of things
| | 03:15 | that are automatically corrected,
and this applies to the entire Suite;
| | 03:19 | it's not just Access.
| | 03:20 | So what you see here is being used
by Word, Excel, and Outlook as well.
| | 03:24 | Correct two initial capitals is selected.
| | 03:27 | So if you accidentally hold down the
Shift key for a little too long and you get
| | 03:31 | the word initial showing up
like that it does get fixed.
| | 03:34 | Capitalizing the first letter of
sentences is something I turned off cause quite
| | 03:39 | often you don't want a capital
letter showing up after a period.
| | 03:43 | So in this case Access would recognize
a period as the end of a sentence and
| | 03:47 | then the next word would be capitalized,
but I use short forms with periods, so
| | 03:51 | I turn that one off.
| | 03:52 | Capitalize names of days is turned on.
| | 03:54 | If you accidentally forget your caps
lock key is turned on, after typing a few
| | 03:58 | characters it'll get fixed for you, and
then replace text as you type is turned
| | 04:02 | on, which means all of these
items down below come into play.
| | 04:06 | So you can see here for example at the
top, if I type in a round bracket, small
| | 04:10 | c, and another round bracket, I get
the copyright symbol, and then there's a
| | 04:13 | whole bunch of frequently
made mistakes down below.
| | 04:16 | You can see the word abbout with two
b's and as I scroll down there's a huge
| | 04:21 | long alphabetical listing.
| | 04:22 | One that happens a lot is that
i before e except after c rule.
| | 04:26 | So if we go down to receive, for example, I
wonder if that one is in there. Getting closer.
| | 04:34 | Look at that recieve, spelled "ieve"
would be replaced automatically with the
| | 04:40 | correct spelling of receive.
| | 04:42 | Now keep in mind, you can
add anything you like in here.
| | 04:45 | You can choose what needs to be
replaced with what and in some cases that
| | 04:49 | could be a short form.
| | 04:50 | For example, r1 I want replaced with Rack 1.
| | 04:57 | By clicking the Add button now, every
time I type in r1, the words Rack 1 will
| | 05:03 | show up in my table, in my database.
| | 05:06 | I'm going to click OK.
| | 05:08 | And I'm going to click
OK again to close that up.
| | 05:11 | So you can add or remove any of the
entries in the AutoCorrect Options and
| | 05:15 | keep in mind too, that you should frequently
check the spelling of the content of your database.
| | 05:21 | In our case, working through a table,
entering a lot of data, checking the
| | 05:24 | spelling now and then, at least at
the very end before you close out of the
| | 05:28 | table, is always a good idea.
| | Collapse this transcript |
|
|
3. Working with Fields and RecordsModifying table design| 00:00 | All right let's talk about a common scenario.
| | 00:02 | You're busy entering data into your
table in Microsoft Access, and then it hits
| | 00:07 | you, you're missing some information,
you need to add something else, but
| | 00:11 | there's no field for you to do it in.
| | 00:13 | So we're going to talk now
about modifying the table design.
| | 00:17 | Still working with tables in Access,
we're going to look at modifying the design
| | 00:21 | from two different views:
| | 00:22 | from our Datasheet view here, as well as
from the Design view, and we'll look at
| | 00:26 | the advantages of each.
| | 00:28 | So let's go back to that scenario
where we want to add some additional
| | 00:31 | information, and in our scenario
it's going to be an album cover.
| | 00:34 | So each of these albums has a cover obviously.
| | 00:37 | It would be nice if we could attach
it to each of the records so that later
| | 00:41 | on, when we get into forms and start
viewing each record, in different ways
| | 00:45 | using some tricks and forms, we'll be
able to actually see the cover of the CD
| | 00:49 | or the record or the tape.
| | 00:52 | Another thing that's been bothering
me for quite some time as we've worked
| | 00:55 | through this sample table, is that some
of the information is getting cut off.
| | 00:58 | Look at Album Title here.
| | 01:00 | Some of it's getting cut off and that's just
simply because the column isn't wide enough.
| | 01:04 | So we're going to modify
some columns widths as well.
| | 01:07 | Now we can do these design
changes from two different views.
| | 01:10 | We can do it right here in our Datasheet view.
| | 01:12 | We can also switch over to Design view,
and there's advantages to each, so
| | 01:16 | let's look at both.
| | 01:16 | We'll start with this annoying
thing that's happening where information
| | 01:20 | is getting cut off.
| | 01:21 | I have a database open called Music
Library 3, and I got it from my Lesson3
| | 01:27 | folder of the Exercise Files, so if you
want to open that up and follow along,
| | 01:31 | you'll be right where I'm right now.
| | 01:33 | So the Album ID you can see is just an
automatic numbering system, and right now
| | 01:37 | it's just way too wide.
| | 01:39 | I need it to be wide enough to see the
title Album ID, but it doesn't need to be
| | 01:43 | this wide, so I can go in between the
two columns, when I see the double arrow,
| | 01:47 | I'll just click and drag to the left.
| | 01:49 | So that works I can still see my title.
| | 01:51 | Even better is to go in
between two columns and double-click.
| | 01:55 | This is a trick you can do in Excel as well.
| | 01:58 | So double-clicking, you can see, will
either increase or decrease the width of
| | 02:02 | the column to accommodate the largest item.
| | 02:04 | So I'm going to go through the rest of them,
here in my Datasheet view, doing this.
| | 02:10 | So it's easier for me as I'm entering
data to actually see everything, see more
| | 02:14 | columns as well as I shrink down some
of these column widths, and now I need to
| | 02:20 | add that new field that's
going to contain the album cover.
| | 02:23 | Now you can see I could do it right from here:
| | 02:24 | Add New Field shows up.
| | 02:26 | I could do some of the tricks like right
-clicking to rename and so on, or I can
| | 02:30 | simply switch to Design view,
and I'm going to do that.
| | 02:33 | I'm going to go up to my View
drop-down and choose Design View.
| | 02:37 | Now this is a little bit easier work
with, especially when we need to define
| | 02:41 | the Datatype and so on.
| | 02:42 | So I'm going to come down here below
Media, and I'm going to type in the name of
| | 02:46 | this new field, which is going to be
Album Cover, and when I click over here in
| | 02:52 | the DataType column, you can see by
default a text datatype shows up, and then
| | 02:58 | you can see the field properties down below.
| | 03:00 | But it's really not text going in there at all.
| | 03:02 | It's going to be an image.
| | 03:03 | So I'm going to click this drop-down
and I'm going to choose from this long
| | 03:07 | list, not Memo, Attachment right down here.
| | 03:11 | And I'll be attaching a graphic image.
| | 03:13 | Now with Attachment selected,
look at the Field properties;
| | 03:16 | there's only a couple to think about.
| | 03:18 | One is a caption, and if I wanted to
have a caption showing up on various forms
| | 03:23 | for example later on, that aren't the
actual label, Album Cover, then I can do
| | 03:28 | that, but I'm going to leave it blank.
| | 03:30 | Album Cover kind of speaks for itself
and it will become the label when I start
| | 03:34 | using forms later on.
| | 03:36 | Is it going to be required?
| | 03:38 | In other words does
something have to be in there?
| | 03:40 | No, I'm going to leave it at No.
| | 03:41 | I may not have album covers for every
single entry so I want to make this optional.
| | 03:46 | So everything looks good, all I
need to do is save my changes.
| | 03:50 | If I don't, if I try to go back to my
Datasheet view, I'll be prompted to make a
| | 03:54 | save and I'm going to click
the Save button to avoid that.
| | 03:57 | So now when I change my view back to
Datasheet, look at that, I've got a new
| | 04:02 | column over here, which is Attachments
and you can see the little paperclip icon
| | 04:08 | represents the fact that
it's an attachment type field.
| | 04:12 | Now you'll notice that there are zeros
showing up in brackets next to each one
| | 04:15 | of these, cause currently
there's nothing in those fields.
| | 04:18 | So to add something, I can click on
the field itself, and you can see I can't
| | 04:23 | actually type in here, it's just a
paperclip icon, but if I right-click, this is
| | 04:28 | the fastest way, and choose Manage Attachments.
| | 04:32 | There are no attachments.
| | 04:33 | I can have more than one, but I
really only need one album cover.
| | 04:36 | If I wanted the back I could do that as well.
| | 04:38 | But I'm going to click Add, and the
next thing I'm going to do is browse over
| | 04:43 | to my Exercise Files, and in the
Lesson3 folder of the Exercise Files you'll
| | 04:53 | find the Boston CD. (ph)
| | 04:55 | Click on that, click OK.
| | 04:58 | It shows up here now.
| | 05:00 | It's a jpeg and when I click
OK, look what happens up here.
| | 05:03 | I've got a1 in there.
| | 05:04 | Now in this Datasheet view, it's probably not
the best view for looking at the album covers.
| | 05:10 | Later on when we explore forms,
you'll see how handy this becomes.
| | 05:14 | Forms are a great way to either enter
your data but also view your data, much
| | 05:19 | better than the Datasheet
view that we're looking at here.
| | 05:22 | So we'll save that for later.
| | 05:24 | We'll put in some album covers and
later on when we work with forms, you'll
| | 05:27 | see how nice we can actually place
those somewhere on the form, where they can
| | 05:31 | be viewed properly.
| | 05:32 | So there's a couple of design changes.
| | 05:34 | We made changes to the actual table
widths, column widths in the table that
| | 05:38 | is, and we made some changes by adding
a field and choosing the type of field
| | 05:43 | that we wanted in there.
| | 05:45 | The Datatype in this case was an
attachment, meaning we can attach actual files,
| | 05:49 | in this case jpegs
representing the album covers.
| | 05:52 | Changing the design of your tables in
Access is easy and it's inevitable that
| | 05:57 | you'll probably at some point or
another want to do it, so keep in mind that
| | 06:01 | changing your database tables is
something that's very common and very easy
| | 06:05 | to do.
| | Collapse this transcript |
| Finding and editing records| 00:00 | We're going to talk about another
scenario here while we're working with data
| | 00:03 | in tables in Microsoft Access that
will pop up from time to time, and that's
| | 00:08 | Find and Find & Replace.
| | 00:10 | Much like using Microsoft Word or
Excel using Find & Replace in those
| | 00:14 | applications is much the same here in
Access, except that all of our data that
| | 00:18 | we're searching through exists in a table here.
| | 00:21 | So we can find specific data when we're
looking for it, and we can also replace
| | 00:25 | that data with something else,
if we use Find & Replace.
| | 00:28 | That's what we're going to look at next.
| | 00:30 | So I want you to imagine for a second
that we've actually got thousands of
| | 00:33 | records as opposed to just 17.
| | 00:36 | You need to click on your Home tab and
you'll notice up here, I'm using Music
| | 00:40 | Library 4, that's from the
Lesson3 folder of my Exercise Files.
| | 00:44 | If you want to follow along
go ahead and open that one up.
| | 00:46 | It's just slightly
different from previous versions.
| | 00:49 | So let's say I want to
locate albums by the Monkees.
| | 00:52 | Well right now I want you to notice
first of all, that my cursor's flashing in
| | 00:56 | the Album ID column.
| | 00:57 | That's important because when we come up
here to click Find in the Find section,
| | 01:01 | you'll notice that, by default I've got
a 1 showing up in here because I was in
| | 01:05 | Album ID record number 1,
and what do I want to look in?
| | 01:09 | It's important that we're not just
looking for Album IDs, but in the entire
| | 01:13 | Album table, so you want that selected.
| | 01:15 | What we're looking for is Monkees, but
we can just type in Monk and decide that
| | 01:21 | we want to match any part of the field;
| | 01:23 | it doesn't have to match the entire
field or the whole field, or even the
| | 01:26 | start of the field.
| | 01:28 | Any part of the field can have Monk in it.
| | 01:29 | We're going to search through all the records.
| | 01:32 | We don't need to match case.
| | 01:33 | When we hit Find Next, you can see we're
brought to, there's Monk in the Monkees
| | 01:37 | and that's Album ID number 8.
| | 01:40 | When I hit Find Next, I go to the next one.
| | 01:42 | I wonder if there's any more.
| | 01:44 | When I hit Find Next, I get a message
saying, no there isn't any more, and this
| | 01:49 | search item was not found, so I click OK.
| | 01:51 | So you can see, if you can imagine
thousands of records, how quickly we can find
| | 01:56 | a specific piece of data in
that table using the Find feature.
| | 01:59 | Now there's a Replace tab right here.
| | 02:01 | I could switch right over to Find &
Replace by clicking this tab, but if I want
| | 02:06 | to start that from the
beginning, I can go up here.
| | 02:09 | Instead of clicking Find, click Replace.
| | 02:11 | It's the exact same dialog box that shows up.
| | 02:13 | You can see the Replace
tab is selected this time.
| | 02:16 | Even what I looked for last time in the
Find What field, Monk is there, and some
| | 02:20 | of the other options I
selected are also previously selected.
| | 02:24 | So they're set there for me by default.
| | 02:26 | What I want to look for this time is
the word Cassette, and I want to replace
| | 02:34 | that with the word Tape;
| | 02:36 | it really should be Tape, not Cassette.
| | 02:38 | I'm going to look in the entire table again.
| | 02:41 | This time I want it to match the
whole field, and I do want to search
| | 02:45 | through all the records.
| | 02:46 | Now if I hit Find Next, it's going
to take me to the first occurrence of
| | 02:49 | Cassette from where my cursor was flashing.
| | 02:52 | Keep in mind it was up here in
Album ID number 9 here by the Monkees.
| | 02:57 | So there it is I can hit Replace.
| | 02:58 | It gets replaced and moves on
automatically to the next one.
| | 03:02 | If I just want to do them all quickly, I
can click Replace All. They're all done.
| | 03:07 | I won't be able to undo this Replace operation.
| | 03:09 | Do I want to continue? The answer is Yes.
| | 03:12 | And let's think about that
for a second, that warning.
| | 03:14 | Is it true that I won't be able to undo that?
| | 03:17 | Well it's true that I won't be able to use
the Undo function to go back to the way it was.
| | 03:22 | But I can do another Find & Replace and
just reverse these items, search for the
| | 03:26 | word Tape and replace it
with Cassette, but I'm happy.
| | 03:29 | I'm going to click Cancel.
| | 03:30 | Now it's says Tape everywhere where
it did say Cassette, and I was able to
| | 03:34 | quickly and easily locate
specific data using the Find feature.
| | Collapse this transcript |
| Organizing and sorting records| 00:00 | So we've been working with tables in
Microsoft Access, and we've been inputting
| | 00:04 | records into a table here.
| | 00:06 | The records that you see listed are
listed in the order that they were entered,
| | 00:10 | and if we look down the left-hand
column over here under Album ID, the numbers
| | 00:14 | that appear here were automatically
generated for us and you can see that
| | 00:18 | basically each of these records is
sorted by the Album ID at this point.
| | 00:22 | But what if we wanted to see a
list of all of our albums by artist,
| | 00:26 | alphabetically listed, or maybe we
want to list all of our albums by Rating,
| | 00:30 | with the highest rated albums at
the top and the lowest at the bottom.
| | 00:34 | We can do that and we can even filter
out records that we don't want to look
| | 00:38 | at for the time being.
| | 00:39 | So we're going to talk bout sorting and
filtering to stay organized, and there's
| | 00:43 | a couple different ways to do it.
| | 00:44 | First of all you'll notice up here on
the ribbon, if your Home tab is selected,
| | 00:48 | you've got a Sort & Filter option here.
| | 00:50 | So we've got sorting buttons to sort in
ascending or descending order, and we've
| | 00:55 | also got some filtering options here.
| | 00:57 | Same thing under Selection and there's even
an Advanced filter if we wanted to do that.
| | 01:02 | Now keep in mind when we're filtering
we're not running a query, we're just
| | 01:05 | viewing the data differently.
| | 01:06 | It's still all there but we're
just viewing certain portions.
| | 01:10 | Let's start with Sorting.
| | 01:11 | Let's say I want to sort all of these by artist.
| | 01:13 | Well, one way to do it is just to
go to the column heading here on the
| | 01:17 | right-hand side and click on the drop-down.
| | 01:19 | Now when I do that I'm going to see
those Sort buttons, Sort A to Z, that's my
| | 01:23 | ascending order and my descending order
is right below it, and notice also down
| | 01:28 | below we've got a Text Filters option and then
we've got check boxes for each of our artists.
| | 01:33 | So I'm going to start with sorting A
to Z. When I give that a click you'll
| | 01:37 | notice that all of my albums are sorted
by artist with Aerosmith at the top and
| | 01:41 | ZZ Top at the bottom, but what's really
important here is that we haven't just
| | 01:44 | sorted the data in this one column.
| | 01:47 | Each of the records has been sorted.
| | 01:49 | Look at the Album IDs are all jumbled over here.
| | 01:52 | We wouldn't want to just sort this
column and then and then leave all of the
| | 01:55 | other columns the same.
| | 01:56 | Then we'd be messing up which Artist belongs
to which Album Title and which Rating, etc.
| | 02:01 | So the records are staying
together as we sort on a specific field.
| | 02:06 | Now you'll also notice that next to
the drop-down arrow there's now that
| | 02:09 | little arrow pointing upwards
indicating that there's a sort on here or that
| | 02:13 | there has been a sort.
| | 02:14 | Let me show you what I mean.
| | 02:15 | Let's do it by rating now, so we have
the highest rated albums at the top.
| | 02:19 | We'll click the drop-down and
we'll do Largest to Smallest this time.
| | 02:24 | So everything gets resorted now.
| | 02:25 | You can see the fives at the top and then the
fours, the threes, and the twos at the bottom.
| | 02:32 | But the other thing that's happening
here, because we did a sort on Artist, is
| | 02:36 | that all of the fives are also
being sorted alphabetically by Artist.
| | 02:41 | So in effect what we're
doing is a multilevel sort.
| | 02:45 | Now let's take it a step further
and do a little bit of filtering now.
| | 02:48 | Back to the Ratings.
| | 02:49 | I want to see all of my albums sorted
by Rating and then alphabetically by
| | 02:53 | Artist, but I only want to
see the fives and the fours.
| | 02:56 | I'm not interested in anything below a four.
| | 02:59 | So I may want to go up to
a filtering option here.
| | 03:01 | Now I can do it by clicking
the Filter button up here.
| | 03:04 | When I do that, you can see what happens.
| | 03:05 | This little drop-down opens up.
| | 03:07 | I'm going to hit Cancel because the
exact same thing happens when I click the
| | 03:11 | drop-down under Rating.
| | 03:12 | So there's my Sort and now down below,
you can see I've got check boxes.
| | 03:16 | One way to filter out the twos and the
threes is to deselect them from here.
| | 03:21 | I don't need blanks in there,
not that there would be any.
| | 03:23 | So I click OK, and you can see all I'm
viewing now are the albums that have a
| | 03:30 | Rating of four or five.
| | 03:32 | The threes and the twos and
anything below that do not show up.
| | 03:36 | If I go up to my Filter button now, you
can see that I get the same drop-down.
| | 03:40 | If I want them all back I can
click Select All and click OK.
| | 03:45 | Similar to that is using
the Selection Wizard here.
| | 03:48 | If I click this drop-down, I can say
give me all of the records that are greater
| | 03:52 | than, or equal to, or between something.
| | 03:55 | Now because I've selected five, and I'm
currently on a record that has a Rating
| | 04:00 | of five, my selections
are showing up with fives.
| | 04:03 | How about all the ones that don't equal five?
| | 04:05 | When I click that, I'll see the fours,
the threes, and the twos, but no fives.
| | 04:09 | Then I've got this Toggle Filter button
now that's shown up, so I can remove the
| | 04:13 | filter and get them all back.
| | 04:15 | So lots of different ways
using sorting and filtering.
| | 04:19 | Keep in mind when you want to
remove all of the sorts that are going on
| | 04:22 | here, we've only got two:
| | 04:23 | Rating and then Artist, but we can remove all
of those sorts by clicking the Clear button.
| | 04:28 | You'll know that all of the
sorts now have been cleared.
| | 04:31 | First of all, the Album IDs are now
back in order over here and you'll notice
| | 04:35 | that those little arrows have
disappeared next to the drop-down arrows on the
| | 04:39 | columns that we were sorting.
| | 04:41 | So if you want to stay organized while
you're entering data into a table, you
| | 04:44 | only want to see specific information, even
though it's still all there you can filter it out.
| | 04:49 | You can get it organized by using the
drop-downs or by using the Sort & Filter
| | 04:53 | options found up here on the ribbon.
| | Collapse this transcript |
|
|
4. Creating Data Entry RulesSetting field properties| 00:00 | You know it really doesn't matter
what kind of a database you're building
| | 00:03 | in Microsoft Access.
| | 00:04 | The data itself is the foundation, so
it's extremely important that that data be
| | 00:09 | accurate and consistent.
| | 00:11 | Take for example, multiple people
entering data into a table in Microsoft
| | 00:15 | Access and one person likes to enter dates
one way and someone enters dates another way.
| | 00:21 | We want to make it so that everybody
inputs a date the exact same way to enforce
| | 00:26 | the integrity of our data.
| | 00:28 | We don't want a lose that.
| | 00:29 | Well there's a number of different
ways for us to enforce data integrity in
| | 00:32 | Microsoft Access and we're going
to look at them in this chapter.
| | 00:36 | We're going to start with the field
properties for one and see how we can force
| | 00:39 | people to enter data a certain way.
| | 00:41 | We're going to look at input masks as
well to narrow that down even further, and
| | 00:46 | validation rules a little bit later as well.
| | 00:49 | So let's start with the field
properties, and you can see I'm using
| | 00:52 | Music Library 4a here.
| | 00:54 | I got it from the Lesson4
folder of the Exercise Files.
| | 00:58 | It should look familiar to you
if you've been following along.
| | 01:01 | Here's a table that has Album ID,
Title, Artist, there's a rating in here,
| | 01:05 | which is a numeric field.
| | 01:07 | You've got Condition, Location, and Media.
| | 01:10 | So we're going to focus in
on this Rating field here.
| | 01:13 | We want to make sure that people are
inputting the right numbers, the right way.
| | 01:17 | So let's start with the Field properties.
| | 01:18 | The easiest way to get to the Design
view is to come up here from the Home tab
| | 01:23 | on the ribbon and click the
Design view button right here.
| | 01:26 | We don't need to click the drop-down
below which includes Design View, but
| | 01:30 | Design view shows up right up here at
the top, and clicking that will switch us
| | 01:34 | to the Design view quickly.
| | 01:35 | You'll notice that it's now the
Datasheet icon that shows up over the View
| | 01:39 | button, and I can switch back
to Datasheet view quickly, going
| | 01:43 | back-and-forth using this button.
| | 01:45 | Now on the bottom right-hand corner
on the status bar, you'll also find the
| | 01:48 | Design view button and the Datasheet
view buttons, along with the other two, and
| | 01:53 | the one that's currently selected is
highlighted, which is our Datasheet view.
| | 01:57 | So let's switch back to Design view.
| | 01:59 | That's where we want to
work on the field properties.
| | 02:02 | And like I said, we're going to focus in on
this Rating field, which is a number data type.
| | 02:07 | So I'm going to click anywhere in here
in the Rating field and down below I'll
| | 02:10 | see the Field Properties for that field.
| | 02:13 | Now the first thing that jumps out
at me is the very first thing here,
| | 02:16 | Field Size set to Long Integer, and
that means I can put in numbers up to
| | 02:21 | 64 characters long.
| | 02:23 | Well my rating system's from 1 to 5, so
I'm using up a lot of space here in my
| | 02:27 | table that won't be used.
| | 02:29 | I'm going to click in here where it
says Long Integer, I'm going to slide over
| | 02:33 | to the right, click the drop-down, and
I'm going to go to Single, there we go.
| | 02:40 | With Single now I know I'm going to
save some space, and I'm only going to be
| | 03:00 | putting in single digits, so
this one works perfectly. (ph)
| | 03:01 | The Format down below now is empty and
if I click down here and click the Format
| | 03:07 | drop-down I can choose from a
number of predefined formats.
| | 03:09 | Well it's definitely not a
dollar amount that's going in there.
| | 03:16 | It's not a percent.
| | 03:18 | It's not a scientific
number that's going in there.
| | 03:19 | It's really just a fixed number,
so I can use this one here, right in
| | 03:34 | the middle: Fixed. (ph) XXXXX
| | 03:35 | So I'll give that a click and it
shows up now in the Format field.
| | 03:42 |
| | 03:52 | Decimal Places, we know
we're not going to need any. (ph)
| | 03:54 | It's set to Auto by default.
| | 03:55 | So I'm going to click the drop-
down here and change that to 0.
| | 03:58 | You can see I can go quite
high with my decimal places.
| | 03:59 | All right we're going to skip over Input
Mask, Caption, and go right to Default Value.
| | 04:09 | We'll talk about Input Masks in the next lesson.
| | 04:10 | The Default Value, well
think about that for a second.
| | 04:11 | If the majority of our albums are
rated at, let's say 4, 4 out of 5, then we
| | 04:15 | could make that the Default
Value and never have to enter it.
| | 04:24 | We'll only enter numbers that
are not 4 when we need to. (ph)
| | 04:25 | So I'm going to set that up as 4.
| | 04:26 | Now there is an Expression Builder
button over here that we'll look at when we
| | 04:29 | get to validation rules.
| | 04:30 | This can help you build equations, and so on.
| | 04:31 | Really it's simple.
| | 04:32 | The Default Value is going to be 4.
| | 04:38 | We'll skip over the Validation Rule and
Text and save that for later, and come
| | 04:48 | down to the Required field. (ph)
| | 04:52 | So do we have to have a Rating?
| | 04:52 | Well, it's set to No by default, which
means we could leave this blank, but I'd
| | 04:55 | like to change that, so I'm going to
click down here in Required and change that
| | 04:57 | to Yes, so that every
album has to have a Rating.
| | 04:58 | So that way whoever is inputting
the data cannot skip over that field.
| | 04:59 | They'll have to enter something here.
| | 05:00 | Index we'll leave at no;
| | 05:01 | it's not a primary key, so we're not
going to have unique values going in here.
| | 05:05 | We're going to see 4s and 3s and
5s repeated throughout this table.
| | 05:08 | Down at the bottom we can also choose how
that is going to be aligned in the column.
| | 05:15 | Right now General is the setting
but I'm going to click the drop-down.
| | 05:30 | I'd like to see those
right down the middle. (ph)
| | 05:30 | So I'm going to choose Center. There we go.
| | 05:39 | So we're making changes to the
design of our table and our database here.
| | 05:43 | We need to save those changes
before we go and test this out.
| | 05:48 | So data integrity rules have been changed.
| | 05:55 | Keep in mind that when you've got a
table that has existing data in it that the
| | 06:13 | existing data may not be
valid for the new rules.
| | 06:15 | Now I'm pretty sure that it is, and I
will continue regardless by clicking Yes.
| | 06:25 | Okay, so let's switch to the
Datasheet view and take a look at our table.
| | 06:33 | Look at the Ratings;
| | 06:34 | they're all down the middle now.
| | 06:38 | They do conform to a single digit, and
no decimal places, so we're okay there.
| | 06:50 | We didn't lose any data as a result of making
those changes to the (ph) field properties.
| | 06:51 | Now to enforce data integrity even further
now, we can go to what's called an Input Mask.
| | 06:55 | Input Masks force people
to enter data a certain way.
| | 06:56 | We're going to look at that next.
| | Collapse this transcript |
| Using input masks| 00:00 | Another excellent way to preserve the
integrity of your data as it gets entered
| | 00:04 | into a table here in Microsoft Access
is to use something called an Input Mask.
| | 00:09 | An Input Mask is very helpful
enforcing how data gets entered.
| | 00:14 | Not exactly what data gets entered,
but how it looks when it is entered.
| | 00:18 | I like to use the example of dates.
| | 00:20 | Everybody likes to enter dates a different way.
| | 00:22 | You may like to enter them day, month,
year using slashes, while I may prefer
| | 00:27 | month, day, year using dashes.
| | 00:29 | Well that wouldn't work in a table if
we're both inputting data at the same time.
| | 00:33 | So we want to enforce data integrity by
keeping it consistent, making sure that
| | 00:38 | anyone who enters data is entering it
the exact same way, and this is what an
| | 00:42 | Input Mask will do for us.
| | 00:44 | In the previous lesson we looked at
field properties for this Rating field here.
| | 00:48 | We changed some of the properties to
make sure there were no decimal places,
| | 00:51 | that it was a number
going in, and it's centered.
| | 00:54 | You can see down here, the Default
Value is set to 4 in our new record that's
| | 00:58 | about to be created.
| | 00:59 | The 4 is already there.
| | 01:00 | So we're able to get closer to data
integrity by setting up some of the field properties.
| | 01:05 | Now we're going to go back to the
Design View to set up an Input Mask.
| | 01:09 | You'll notice up here in the Title bar
I'm using Music Library 4b, and I got
| | 01:14 | that from the Lesson4
folder of the Exercise Files.
| | 01:16 | So if you're skipping to this lesson just go
ahead and open that one up to get all caught up.
| | 01:21 | The next thing I'm going to do
is switch over to Design View.
| | 01:23 | There's a couple different ways to do that.
| | 01:25 | Look down here in the bottom
right-hand corner on the status bar.
| | 01:28 | There are View buttons down
here including Design View.
| | 01:31 | We've got our Pivot Chart,
Pivot Table and Datasheet View.
| | 01:35 | Datasheet View is currently selected.
| | 01:36 | That's what we're looking at right now.
| | 01:38 | An even faster way to switch between
Design and Datasheet Views is to use
| | 01:43 | this button up here.
| | 01:44 | On the View drop-down we'll see those
same four choices, but right above is
| | 01:47 | the Design View icon.
| | 01:49 | So if you click on that to switch
to the Design View and it changes to
| | 01:52 | the Datasheet View.
| | 01:53 | So I can click it to switch back
-and-forth, quickly and easily.
| | 01:57 | So in the Design View, again we're
going to focus in on this Rating field here.
| | 02:02 | Down below in the Field Properties you can
see what we set up in the previous lesson.
| | 02:06 | But now we're going to go
to the Input Mask right here.
| | 02:09 | Now an Input Mask, when we're working
with a number field like this requires us
| | 02:13 | to enter it manually.
| | 02:14 | There is a button to help automate
things but that'll be working with a text
| | 02:18 | field or a date field.
| | 02:19 | Now an Input Mask is broken up into
three sections and the three sections are
| | 02:23 | separated by semicolons.
| | 02:25 | The first section is going to contain
characters, both literal characters and
| | 02:29 | the mask characters.
| | 02:31 | The literal characters are the ones
that actually stay there, like brackets
| | 02:35 | around an area code and dashes, and
the mask characters are representative of
| | 02:41 | what's going to go into this field.
| | 02:43 | That's the first section.
| | 02:44 | After the semicolon then is where we
choose whether or not we're going to keep
| | 02:47 | the mask characters with the data that
gets entered and store that in the table,
| | 02:52 | or do we just want the data.
| | 02:54 | And then after the next semicolon, the
third section is where we decide if we're
| | 02:58 | going to use a placeholder or not.
| | 03:00 | So if we were entering phone numbers,
we might want to have the # representing
| | 03:04 | the various numbers, just so people
know how many characters they need to
| | 03:07 | input, but it's optional.
| | 03:08 | We don't have to have it either.
| | 03:10 | So for our Input Mask, we want to
make sure that it's one single character.
| | 03:14 | Is that character optional or it is it required?
| | 03:17 | Well we've already said it's required
down below, so I'm going to put in a 9.
| | 03:20 | A 0 is the other option if it's
optional, but we're going to put in a 9.
| | 03:24 | We're going to put in our semicolon now,
and if we wanted to we can store the
| | 03:29 | actual mask data with the data that
gets entered, but there is no mask data
| | 03:34 | here, there's no extra
characters that go in there.
| | 03:36 | So we don't have to put anything in here.
| | 03:38 | If we wanted to we could put a 1 or a 0.
| | 03:42 | So the one is going to
represent us just storing the data.
| | 03:46 | A 0 would mean we want the mask data and
the actual data that gets entered in here.
| | 03:52 | Next we'll put in a placeholder.
| | 03:53 | Now if we wanted to we could put in an
underscore for example, and that would
| | 03:56 | show the spot where the actual characters get
typed, but it's only going to be one character.
| | 04:02 | We don't need it and we want to make
sure that that default number of 4 that
| | 04:05 | we've set up down here,
the Default Value, shows.
| | 04:08 | If we put a placeholder in here,
it replaces the 4. So that's it.
| | 04:11 | I'm going to hit Tab.
| | 04:13 | It moves me to the next field
and preserves my Input Mask.
| | 04:17 | Now if I go to switch to Datasheet View,
I'm going to be prompted to save my
| | 04:20 | changes, so I might as well come
up here and save them ahead of time.
| | 04:23 | Now I'm going to go to my Datasheet View.
| | 04:25 | This switches me over.
| | 04:27 | You can see the 4 is still showing up
here in the new record, and I'm just going
| | 04:31 | to click over here by CD and
hit my Tab key a couple of times.
| | 04:34 | It gets me down to the new record.
| | 04:36 | I'm going to hit Tab again,
then I'm going to typed in Now! 2.
| | 04:42 | Again that's Various artists.
| | 04:44 | The Rating's 4, that's perfect. It's on CD.
| | 04:48 | I'm going to put in Excellent here.
| | 04:53 | This is actually on Rack 4. I just got it.
| | 04:55 | It's on the new rack. It's a CD.
| | 04:58 | Now if I go back here to my Rating,
and I try to put in more than one digit.
| | 05:03 | Let's say I want to put in 33.
| | 05:04 | Type in the 3, and then as I hit 3 again,
it's not letting me add any other characters.
| | 05:11 | I'm only allowed the one.
| | 05:13 | So 4 was the default. I can put in a 1.
| | 05:15 | I could put in a 2, a 3, a 4, a 5.
| | 05:21 | I can also put in a 6.
| | 05:23 | So I can only put in one character.
| | 05:25 | I'm going to leave it at 4, but I'm also
allowed to put in numbers higher than 5.
| | 05:29 | That takes us to the next lesson
where we're going to talk about
| | 05:33 | Validation Rules.
| | Collapse this transcript |
| Setting validation rules| 00:00 | Okay here's where you get to feel a little
bit like a programmer using Microsoft Access.
| | 00:05 | What we're going to do now to take
data integrity to the next level is create
| | 00:09 | rules for what data can go into a field.
| | 00:13 | So as data input people start entering
information into the various fields, we
| | 00:17 | want to force them to input only certain data.
| | 00:20 | For example, in our Rating column
here we have a rating system from 1 to 5.
| | 00:24 | We don't want people putting
zeros or sixes for example.
| | 00:28 | That's not acceptable.
| | 00:29 | So we can set up a rule that says it
has to be 1, 2, 3, 4 or 5. Nothing else.
| | 00:34 | Look at some of these other
columns as well. The Condition.
| | 00:37 | Well we've only got Poor, Good and Excellent.
| | 00:39 | So we want those three choices, and
we want people to enter it that way and
| | 00:43 | spell it correctly too.
| | 00:44 | Same thing goes for the Location and the Media.
| | 00:47 | So we can set rules for each of
these and we're going to have fun with
| | 00:50 | another Input Mask as well.
| | 00:52 | So we do all of this from the Design
View like we did for our Input Mask and
| | 00:55 | our Field Properties.
| | 00:57 | Notice up here that I'm
now using Music Library 4c.
| | 00:59 | If you've been following along, no
problem, but if you're jumping to this lesson
| | 01:03 | this is the one you'll want
to open up to be all caught up.
| | 01:06 | Music Library 4c from the
Lesson4 folder of your Exercise Files.
| | 01:11 | Once you've got it open
let's switch to Design View.
| | 01:13 | We'll click the Design View button here
and we'll go back to our Rating field.
| | 01:17 | We'll start with that one here, so
clicking in the Rating field, you can we've
| | 01:20 | already set up some things including an
Input Mask that says it's got to be one
| | 01:24 | digit, but we haven't said
yet what those digits can be.
| | 01:28 | We want 1, 2, 3, 4, or 5. That's a rule.
| | 01:31 | So we come down here to the Validation
Rule part and notice that we've got a
| | 01:35 | little button over here for
building our Validation Rules.
| | 01:38 | You can click that to open
up the Expression Builder.
| | 01:41 | Now we can use some of the built-in
functions by double-clicking Functions,
| | 01:45 | and clicking Built-In Functions and you can
see we've got some prebuilt choices for us.
| | 01:48 | Or we can just come in here
and type in what the rule is.
| | 01:52 | So in this case it has to be 1, Or, I'm
going to click the Or button, 2, click
| | 01:59 | Or again, 3, Or, 4, Or, 5.
| | 02:04 | That's our rule right there.
| | 02:05 | We just click OK, that gets entered
into the Validation Rule field, and now,
| | 02:10 | this is kind of neat, we can add some
text that'll show up when people enter
| | 02:14 | something other than 1 through 5, such as:
| | 02:19 | You must enter a number
from 1 to 5, just like that.
| | 02:27 | So there's our Validation Rule.
| | 02:29 | We've set it up, we've added some
Validation Text as well, so if people don't
| | 02:33 | enter the right data, we're at least
giving them some information about what
| | 02:36 | they should be entering.
| | 02:37 | So we're going to save that change.
| | 02:39 | We'll click the Save button.
| | 02:41 | Data integrity rules have changed.
| | 02:43 | We know that we just set them, and notice
that it's just saying it might take a long time.
| | 02:47 | If you've got hundreds and hundreds of
records for example, and you've already
| | 02:50 | got data in the Rating field it could
take a while to check to make sure that
| | 02:54 | data rules are being followed.
| | 02:56 | So we're going to click Yes, and we're
going to switch to our Datasheet View,
| | 02:59 | and I'm going to click in here
and just Tab over to a new record.
| | 03:04 | Now I'm going to enter in an Album Title.
| | 03:06 | I'm going to enter in Bad by Michael Jackson.
| | 03:16 | The Rating I'm going to change to a 5.
| | 03:19 | Now what if I try to put in
a 6 here. Let's type in 6.
| | 03:23 | As soon as I hit Tab to move to the
next field, oh, there's that text.
| | 03:26 | You must enter a number
from 1 to 5. So click OK.
| | 03:29 | I better put in 5, and now as I Tab through I
can start entering the rest of the information.
| | 03:35 | But we can create some Validation Rules
for these other fields as well, so that
| | 03:40 | people can only put in one of three choices:
| | 03:42 | Poor, Good or Excellent for the Condition.
| | 03:45 | They can choose from Rack 1 through 4
and then same thing for the Media type.
| | 03:50 | So what we're going to do now is go
back to Design View and we're going to work
| | 03:54 | on those other ones.
| | 03:55 | Let's start with the Condition.
| | 03:58 | So the Condition can be one of three choices;
| | 04:01 | that's a Validation Rule.
| | 04:02 | When we work with text we put it in quotes.
| | 04:05 | So for example, I'm going to put in
a quote here, double quotes, and I'm
| | 04:10 | going to put in Poor.
| | 04:12 | Now I can type this or I can go to the
Expression Builder and do it there if I wanted to.
| | 04:16 | So Good in double quotes Or and in double
quotes the last choice which is Excellent.
| | 04:27 | Now if I wanted two for Validation
Text, Must be Poor, Good, or Excellent.
| | 04:33 | There we go. (ph)
| | 04:37 | Now when I hit Save, watch what
happens here, same information pops up saying
| | 04:41 | it could take a while. I say Yes.
| | 04:43 | Existing data violates the new setting.
| | 04:46 | That's because I've got some blanks in
there don't I, but that's okay, I'm going
| | 04:49 | to click Yes to continue, and I'm going
to switch to my Datasheet View here, and
| | 04:54 | we're going to continue with our new
record here and I'm going to type in
| | 04:57 | something like okay. Look at that.
| | 05:01 | Must be Poor, Good, or Excellent.
| | 05:03 | So I click OK and I'll take that
out and I'm going to type in Good.
| | 05:08 | Tab over and now I'm
ready to move on to the Rack.
| | 05:11 | Well, let's change that up as well.
| | 05:13 | Let's make some rules for what
can go into the Location field.
| | 05:16 | We'll go to our Design
button to switch to Design View.
| | 05:21 | We'll click on the Location field and
we're going to use an Input Mask here as
| | 05:25 | well, because what we really want to
do is have some text in there: Rack.
| | 05:29 | So all you need to enter is
the 1, the 2, the 3, or the 4.
| | 05:33 | So it's going to look kind of like this:
| | 05:35 | I'm going to put Rack and a space in
quotes, and then we want a number after that.
| | 05:40 | So we're going to put in a 0 to
represent an optional number, and then we'll
| | 05:44 | put in our semicolon.
| | 05:46 | This is all covered in the previous lesson.
| | 05:48 | We do want to save all of the Mask Data,
like the word Rack, with the data, so
| | 05:52 | we're going to put in a 0 here.
| | 05:54 | The choices are 0 or 1, and then we're
going to put in a semicolon, and if we
| | 05:58 | want a placeholder, we can put it in here.
| | 06:00 | I'm going to put in the
underscore. There we go.
| | 06:03 | Validation Rules now.
| | 06:05 | Obviously this time we've got four
choices, so what we want to do, I'm going to
| | 06:09 | go into the Expression Builder here,
and I'm going to type in, in quotes,
| | 06:14 | double quotes, Rack 1, Or, and I'm going to copy
this here, so I don't have to type it each time;
| | 06:22 | Control+C on the keyboard.
| | 06:24 | Control+C, Or, Control+V, there we
go, and I'm just going to change the
| | 06:32 | numbers now to 2, 3, and 4.
| | 06:39 | When I click OK, that's entered for me.
| | 06:42 | Now I'm going to hit my Save button.
| | 06:43 | I'm going to see a familiar message.
| | 06:45 | I'm going to say Yes.
| | 06:47 | Existing data violates that. We know.
| | 06:48 | We've got a blank in there, but that's okay.
| | 06:50 | When we click Yes and switch to the Datasheet
View, you can come in here. Look at it that.
| | 06:55 | The word Rack is already there, so we
would move from Good by hitting Tab.
| | 06:59 | We just type in a number here.
| | 07:01 | I'm going to type in 4, and you
can see Rack 4 shows up for me.
| | 07:05 | I hit Tab and we're on to the Media.
| | 07:07 | So here's where we can set up yet another rule.
| | 07:09 | So let's get some practice.
| | 07:11 | We'll go to the Design View now,
switch over to Media and creative a
| | 07:16 | Validation Rule here.
| | 07:17 | So this is text again.
| | 07:18 | Let's just type it in here this time.
| | 07:20 | So we'll use our double quotes.
| | 07:21 | The Media can be CD, Or, it can be Tape,
Or, and in double quotes we'll put in
| | 07:30 | the other option, which is Vinyl. There we go.
| | 07:34 | If we want, in the Validation
Text, put a message in there.
| | 07:38 | Must be CD, Tape or Vinyl. There we go.
| | 07:44 | Let's save that up.
| | 07:44 | We're going to see the same messages again.
| | 07:48 | Obviously, we've got a blank in there,
that's why we see this violation.
| | 07:51 | It's okay, we'll click Yes, go back to
the Datasheet, and from Rack 4 we'll hit
| | 07:56 | Tab, and let's try and type
something in like Cassette.
| | 08:01 | When I hit Tab to move on, it says, Oh,
must be Cd, Tape, or Vinyl. So I click OK.
| | 08:06 | I'm going to double-click
here and just type in Tape.
| | 08:10 | When I hit Tab, that one's
accepted, and I've saved my changes.
| | 08:14 | So you can see how, now where we're
preserving the integrity of our data by
| | 08:18 | forcing people not only to put in the
data that we want, but to make it look the
| | 08:22 | way we want as well.
| | Collapse this transcript |
|
|
5. Relational Database TechniquesCreating key fields| 00:00 | To this point in this title, we've been
working with a single table in Microsoft
| | 00:06 | Access, and we've done a lot of stuff
with this table called Album here, where
| | 00:09 | we've added some fields, and we've
worked on field properties and we've also
| | 00:13 | adjusted some of the Validation Rules
and the Input Masks, etc, but to be quite
| | 00:18 | frank, we could have done everything
we've done so far with this single table in
| | 00:22 | Microsoft Excel in a spreadsheet, but
we know from a previous lesson when we
| | 00:26 | discussed design concepts that
a flat file is very inefficient.
| | 00:31 | What would happen over time is we
would see a lot of redundancy, repetition,
| | 00:36 | duplication of records.
| | 00:37 | So by creating multiple tables and
relating them to one another, we create a
| | 00:42 | relational database that's far more efficient.
| | 00:45 | We'll be able to quickly and easily
find data, look it up, present it later on.
| | 00:50 | So what we need to do in this section is
talk about relationships between tables
| | 00:55 | and to do that we first need to discuss keys.
| | 00:58 | Now I'm using the Music Library 5a
database from the Lesson 5 folder of
| | 01:04 | your Exercise Files.
| | 01:05 | So you'll need to open that one up,
because you'll notice over here in the
| | 01:07 | Navigation Pane, I've got more
than just the Album table now.
| | 01:11 | I've created a Performers
table and a Songs table.
| | 01:15 | Now, we said we were going to do that
in a previous lesson when we were talking
| | 01:19 | about design on paper. So here they are.
| | 01:22 | You know how to create a table.
| | 01:23 | I've just gone ahead and created these
two tables and we'll take a look at them
| | 01:27 | in a minute to see what fields exist in there.
| | 01:30 | If we go to the Design View here for
our Album table, we'll see the various
| | 01:34 | fields, their DataTypes and properties.
| | 01:36 | What's really important to remember though
is that the Album ID is our unique identifier.
| | 01:41 | We'll never have a Duplicate ID for
any given album, and you'll notice that
| | 01:45 | that's because we've got this little key
icon next to Album ID representing that
| | 01:50 | this is our primary key.
| | 01:52 | All right, so if we go over to the Performers
table now and double-click it to open it up.
| | 01:58 | We're currently in the Datasheet View.
| | 02:00 | You can see we got a Performer ID field.
| | 02:02 | I'm just going to stretch that out a little bit.
| | 02:04 | We've got First Name and
Last Name fields. That's it.
| | 02:07 | If we go to the Design View, we realize
that we don't have a primary key here.
| | 02:13 | So we could have two different
performers, for example with the same Performer
| | 02:18 | ID and we don't want that.
| | 02:19 | So what we're going to do is set up the
primary key for this field here: Performer ID.
| | 02:24 | So I just need to be anywhere in the field.
| | 02:26 | I'm going to go up to the Ribbon.
| | 02:28 | My Design tab is selected here and click
on the Primary Key button. It's that easy.
| | 02:34 | So we've now set up the
primary key for our Performers table.
| | 02:38 | We need to save those
changes for them to take effect.
| | 02:41 | Now take a look at what I've
done over here in the Songs table.
| | 02:45 | I'm going to double-click
it and switch to Design View.
| | 02:48 | You can see here we've got the
Song Title, the Genre, the year it was
| | 02:53 | launched, the Decade, and then I've
got two fields down here that I can find
| | 02:57 | in the other two tables.
| | 02:58 | There's the Performer ID, which is a
primary key in the Performers table, and
| | 03:03 | there's the Album ID, which is a
primary key in the Album table.
| | 03:07 | So I don't actually have a primary key
or a unique identifier in this particular
| | 03:12 | table, and that's okay in Access, you
can do that, but just to be safe later on,
| | 03:16 | it might be a good idea to have a
Song ID, and we can have it automatically
| | 03:21 | generated for us so we don't have to
worry about it and although we don't need
| | 03:24 | it right now, maybe down the line it
will be important if we start to add
| | 03:28 | additional tables and we
want to be able to link them.
| | 03:31 | So we don't want to have to go
back and re-design our table.
| | 03:34 | So what we're going to do now is actually
insert a field, and I'm up here at Song Title.
| | 03:39 | I'm going to go up to the Ribbon, under
the Design tab here and click Insert Rows.
| | 03:43 | So I've got a new row, which
will represent my new field.
| | 03:47 | I'm going to call it Song ID and over
here in the Data Type, we want that to be
| | 03:51 | an automatically generated number.
| | 03:53 | They have AutoNumber here
for us; that's perfect.
| | 03:57 | That'll automatically generate a number;
| | 03:58 | we won't have to input anything
there and we'll know for sure that no
| | 04:02 | number will be duplicated.
| | 04:04 | So now all we have to do is make it
the primary key by coming up here in the
| | 04:07 | Ribbon and clicking Primary Key.
| | 04:09 | As soon as we did that in the Field
Properties down below, you may have noticed
| | 04:13 | next to Indexed, it went from Yes and (
Allow Duplicates) to (No Duplicates), so
| | 04:18 | its indexed and there cannot be a
duplicate because it's a primary key.
| | 04:23 | So we want to save that change as well.
| | 04:26 | So now we've got our three tables.
| | 04:28 | Notice the three tabs up here.
| | 04:30 | Here's our Performers;
| | 04:31 | the Performer ID shows up
here as the primary key.
| | 04:34 | In the Songs table it shows up down
here, and then if we go over to the Album
| | 04:39 | tab we've got an Album ID as the primary key.
| | 04:42 | We'll go back to Songs and
there's Album ID down there.
| | 04:45 | So we're going to be able to relate each of
these tables one to the other in a moment.
| | 04:51 | That's what we're going to do next
when we talk about table relationships.
| | Collapse this transcript |
| Creating table relationships| 00:00 | All right it's time to have
some fun now with relationships.
| | 00:03 | We're going to put the relation
back into relational databases now.
| | 00:08 | In the previous lesson we saw that
we had three tables in this database:
| | 00:11 | the Album, Performers, and Songs tables.
| | 00:14 | Each one of those is set up now
with a primary key or a field that will
| | 00:18 | contain a unique identifier, and then
some of those fields appear in other
| | 00:22 | tables as well, so that's how we can
build the relationship, join the two
| | 00:25 | tables by the common fields.
| | 00:29 | So to create the relationships, the first thing
that we need to do is close up all the tables.
| | 00:34 | It's hard to create the
relationships and save that relationship if the
| | 00:37 | tables are in use, and right now you
can see the Songs, Performers, and Album
| | 00:41 | tables are all open here.
| | 00:43 | So I'm going to right-click on the Songs tab.
| | 00:45 | It doesn't really matter which tab you right-
click on, and select Close All. There we go.
| | 00:51 | Up at the top you'll notice
that I'm using Music Library 5b.
| | 00:56 | Now if you jumping to this lesson that's
the name of the database you want to open.
| | 01:00 | If you're continuing on from the previous
lesson you'll still be using Music Library 5a;
| | 01:05 | it's all the same stuff.
| | 01:07 | Now we need to create the
relationship between those three tables, so
| | 01:10 | we're going to go over here to the Database
Tools tab on the Ribbon and give it a click.
| | 01:14 | Right below that you'll find the
Relationships button. Perfect.
| | 01:18 | When we click that, the Relationships
tab opens up, but for the very first time
| | 01:23 | only the Show Table
dialog box will also show up.
| | 01:27 | Now we can create relationships between
tables, between queries, and both, but
| | 01:32 | we haven't got to queries yet, so we'll
save that for later and just concentrate
| | 01:36 | on the tables for now.
| | 01:37 | There's our three tables in this database,
Album, Performers, and Songs, and all
| | 01:41 | we need to do is get them from here to here.
| | 01:45 | So with Album already highlighted or
selected, I can click the Add button and
| | 01:49 | you can see that table gets added.
| | 01:50 | I'll click Performers and Add, and a
shortcut, I'll just double-click Songs to
| | 01:55 | add that one as well.
| | 01:57 | So once I've got them all in there, I can close
this dialog box, and I've got my three tables.
| | 02:02 | Two of them have scrollbars
indicating I'm not seeing all of the fields.
| | 02:06 | So what I'm going to do is just click
and drag until I see them all. Perfect.
| | 02:10 | Just like that.
| | 02:12 | The other thing that I need to do is
just move these around a little bit.
| | 02:15 | I'm going to move Performers over here,
Songs in the middle, and that way it's
| | 02:20 | going to look a little bit
neater when we join these tables up.
| | 02:23 | You'll see what I mean in a second.
| | 02:25 | So how do we join them up?
| | 02:26 | How we create the relationship?
| | 02:28 | Well it's pretty easy actually.
| | 02:29 | We know that Album ID is the primary key
here, we see the key in the Album table.
| | 02:34 | We also see that same field over here
in the Songs table, and it's spelled
| | 02:38 | exactly the same way.
| | 02:40 | So all I need to do is click and drag
from the key, right on top of the second
| | 02:45 | Album ID field and release and the
Edit Relationships dialog box will appear.
| | 02:50 | So you can see a relationship is being
created between the Album ID fields, one
| | 02:56 | from the Album table, one from the Songs table.
| | 03:00 | Down below, you can see by default,
it knows to create a one-to-many
| | 03:03 | relationship, because Album ID in the
Songs table is not a primary key, and that
| | 03:09 | means that one-to-many.
| | 03:11 | I can have one ID in the Album table and see
that Album ID many times in the Songs table.
| | 03:17 | So that's perfect.
| | 03:18 | All I need to do now is
Enforce Referential Integrity.
| | 03:22 | I'm going to click this check box.
| | 03:23 | We're going to talk about this in
detail in a couple lessons from now so we'll
| | 03:27 | just leave that be, but it does need to
be turned on, and it'll all make sense a
| | 03:31 | little bit later on.
| | 03:32 | Now we can also look at the Join Type.
| | 03:34 | So what happens when we take tables
that already have data in them and start
| | 03:38 | joining them like this.
| | 03:39 | Well I'm going to click the Join Type
button and you'll see I've got three
| | 03:43 | options for Join Properties:
| | 03:45 | Only include rows where the joined
fields from both tables are equal.
| | 03:49 | Well I know that my Album table is
full of data, but the Songs table doesn't
| | 03:53 | have anything in it yet.
| | 03:54 | So maybe option two will be better:
| | 03:56 | Include all records from 'Album' and
only those records from the Songs table
| | 04:01 | where the joined fields are equal.
| | 04:03 | That sounds like what I want.
| | 04:05 | What's the third option?
| | 04:06 | Includes all records from the Songs
table, I don't have any, and only those
| | 04:10 | records from the Album table
where the joined fields are equal.
| | 04:13 | That does not apply either.
| | 04:14 | So with number two
selected, I'm going to click OK.
| | 04:16 | So right away I see that two
fields are going to be joined together.
| | 04:23 | Enforcing Referential Integrity;
| | 04:25 | we'll talk about that later.
| | 04:26 | One-to-many is the relationship.
| | 04:28 | When I click Create, look what happens.
| | 04:31 | I see the relationship from Album ID
here, there's the one, to the infinity
| | 04:38 | symbol representing many in the Songs table.
| | 04:42 | So let's do the same now with the Performers.
| | 04:44 | We'll drag the Performer ID over and
into the Songs table right on top of
| | 04:50 | Performer ID and release. So there we go.
| | 04:54 | We've got the two fields, the two tables.
| | 04:57 | We do want to enforce referential integrity.
| | 04:59 | It will be one-to-many.
| | 05:02 | The Join Type really doesn't matter,
both of these tables are empty right now,
| | 05:06 | so we can only include rows where the
joined fields from both tables are equal;
| | 05:09 | that'll work and click OK.
| | 05:12 | When I click the Create button,
there's my new relationship.
| | 05:16 | Now as I move these tables around,
they keep their relationship.
| | 05:19 | They're always joined.
| | 05:22 | If at any time I need to edit one of
these relationships, I can go to the
| | 05:27 | connector and double-click.
| | 05:29 | It opens back up the Edit
Relationships dialog box.
| | 05:32 | I could go up here on the Ribbon and choose
Edit Relationships as well. I'll click Cancel.
| | 05:40 | All I need to do now is save those changes.
| | 05:42 | When I click the Save button, all of
my relationships will be stored, and
| | 05:47 | I'm ready to move on.
| | 05:49 | In the next lesson we're going to
spend a little bit more time digging deeper
| | 05:53 | into referential integrity
and why it's so important.
| | Collapse this transcript |
| Enforcing referential integrity| 00:00 | It's time now to discuss an extremely
important topic when it comes to working
| | 00:04 | with a relational database,
and that's referential integrity.
| | 00:08 | Now in the previous lesson we set up
relationships between our tables in our database.
| | 00:13 | We see those relationships now
as one-to-many relationships.
| | 00:17 | We see the primary keys in each of
the tables, but let's talk about a
| | 00:21 | scenario that could happen.
| | 00:23 | Let's say we gave away an album and we
no longer have that album in our library.
| | 00:27 | So we delete the album from the Album
table knowing that there are songs in the
| | 00:32 | Songs table that reference an
Album ID now that no longer exists.
| | 00:37 | What happens to those records.
| | 00:38 | Well without enforcing referential integrity,
well we would have what's called orphans.
| | 00:43 | We'd have a number of songs with an Album
ID that can't be found in the Album table.
| | 00:49 | Now by enforcing referential integrity,
a little check box that we checked off
| | 00:53 | in the previous lesson, we'll look at
it again in a second, we're making sure
| | 00:57 | that we can't let that happen.
| | 00:58 | Orphans won't exist as long as
we're enforcing referential integrity.
| | 01:02 | So that's going to mean that we can't
change the primary key for an Album ID and
| | 01:06 | we can't even delete it, but let's say
we gave away an album or we sold it for
| | 01:11 | example, and it no longer exists in our library.
| | 01:13 | We want to be able to delete it, and
in those cases we want some kind of
| | 01:17 | update to happen here in the Songs table,
and that's what we're going to talk about now.
| | 01:21 | So take a look at my title bar.
| | 01:22 | I'm using the Music Library 5b database.
| | 01:26 | So if you're jumping to this lesson,
you can go into your Lesson5 folder in the
| | 01:29 | Exercise Files and open it up.
| | 01:31 | We created the relationship in the
previous lesson by just simply clicking and
| | 01:35 | dragging the primary key over on top
of the foreign key in the related table,
| | 01:39 | and now we're going to talk about
enforcing that referential integrity.
| | 01:43 | So that's going to mean
editing our relationships.
| | 01:46 | To do that we click on the connector
between the two tables, you can see it's
| | 01:49 | highlighted, and we can go up here and
click Edit Relationships to bring up the
| | 01:54 | Edit Relationships dialog box.
| | 01:57 | So in the previous lesson we did
check off Enforce Referential Integrity.
| | 02:01 | So by doing that we knew we would not
have unrelated records in the related
| | 02:06 | table, but here the other two
options I want to talk to you about.
| | 02:09 | What if we change the primary key?
| | 02:11 | I'm going to move this over.
| | 02:12 | Let's say over here in the Album ID we want
to change the actual ID for one of our albums.
| | 02:18 | Well we would want those IDs in the
related table, the Songs table here, to get
| | 02:23 | updated for us automatically, so
that they continue to match each other.
| | 02:27 | Well, then we would check off
this check box here that says Cascade
| | 02:30 | Update Related Fields.
| | 02:32 | Now what happens if we sold one of the
Albums in our collection and it no longer
| | 02:37 | exists, so we're deleting an Album ID.
| | 02:39 | That means we might have a number of songs
referencing an Album ID that no longer exists.
| | 02:44 | We can't have that because we're
enforcing referential integrity, but what we
| | 02:48 | can do is have Access automatically
delete all of the songs in our Songs
| | 02:52 | table that reference that Album ID that's
been removed, and that's this check box here:
| | 02:57 | Cascade Delete Related Records.
| | 03:00 | So with those two checked off, we can click
OK and know that we'll always have valid data.
| | 03:07 | Let's go over to this one now.
| | 03:08 | I'm going to click on the
relationship between Performers and Songs.
| | 03:11 | Another way to edit relationships,
a little shortcut, is just to
| | 03:14 | double-click the connector.
| | 03:16 | So double-clicking brings up the Edit
Relationships dialog box for these two tables.
| | 03:20 | You can see Performers and Songs.
| | 03:23 | Now, we also enforced referential
integrity in the previous lesson for these
| | 03:27 | two tables, what do we want to happen if we
remove a performer from the Performers list?
| | 03:33 | Do we want those Performer IDs to be deleted
as well, in the Songs table. Well, yes we do.
| | 03:40 | So we're going to click this check box here.
| | 03:42 | If we change a Performer's ID, we also
want it updated in the related table, so
| | 03:46 | we'll check off this box
as well, and we'll click OK.
| | 03:50 | All right we should save those changes,
so clicking the Save button will update
| | 03:55 | our tables, their relationships, and
now we can feel confident knowing that if
| | 04:00 | we change an ID in one table,
it'll change in the related table.
| | 04:04 | If we remove one from the primary
table, they will all be removed from the
| | 04:09 | secondary or the related table as
well, all thanks to something called
| | 04:13 | referential integrity.
| | Collapse this transcript |
| Using subdatasheets| 00:00 | Now that you're feeling very comfortable
with the term referential integrity and
| | 00:04 | table relationships, it's time to talk
about something that will help you when
| | 00:08 | it comes to data input,
and that's a sub datasheet.
| | 00:11 | As soon as we create relationships
between tables like we have here in our
| | 00:14 | database, linking the Album ID in the
Album table to the Album ID field in the
| | 00:19 | Songs table, and also linking the
Performers table by Performer ID to the
| | 00:24 | Performer ID field in the Songs
table, we now have a relationship.
| | 00:28 | We've enforced referential integrity so
that the way we set it up if we were to
| | 00:32 | remove an Album, all of the songs with that
related Album ID would be removed as well.
| | 00:37 | If we were to change information in the
Performer ID in the Performers table, we
| | 00:42 | would see those changes in the related
table under Songs here, all the Performer
| | 00:46 | IDs would be updated.
| | 00:47 | So with all of that in mind, now we're
going to look at a little feature, the
| | 00:51 | sub datasheet, which is going to
help you when it comes to data input.
| | 00:56 | Now before we continue you're going to need to
open up the database called Music Library 5c.
| | 01:01 | That's in your Lesson 5 folder of the
Exercise Files, and once you've got that
| | 01:06 | open I want you to go over to the
Performers table and double-click it here in
| | 01:10 | the Navigation Pane.
| | 01:12 | You'll see, I've added some performers for you.
| | 01:15 | Now what's new about this, something you
haven't recognized maybe, is the little
| | 01:19 | plus signs down the left-
hand side, next to each record.
| | 01:22 | This represents the sub datasheet which
is a Datasheet view of the related table.
| | 01:29 | So we know Performers is related to
the Songs table through that Performer
| | 01:33 | ID, so if I click the plus sign here next
to Boston I'm going to see the sub datasheet.
| | 01:39 | Now there are no songs in here yet, but
I can use the sub datasheet to actually
| | 01:43 | input new songs using this Performer ID.
| | 01:47 | Notice that there's no Performer ID column.
| | 01:50 | I don't need to put that in because
it's related and it will automatically be
| | 01:54 | updated with this Performer ID.
| | 01:56 | I do need to put in the Album ID though and
that I may not know off the top of my head.
| | 02:02 | If I go over to the Album table and
double-click it, you'll notice that all of
| | 02:06 | the albums show up here with
the Album ID's and here we go.
| | 02:10 | We've got plus signs next to each one
of these as well representing the related
| | 02:14 | table, which again is the Songs table,
so clicking the plus sign here next to
| | 02:19 | Boston will display the
Songs table in a sub datasheet.
| | 02:23 | Again, I don't have any songs input yet,
but I can start inputting them here.
| | 02:27 | Notice also that the Album ID column
now doesn't show up here, but there is a
| | 02:31 | Performer ID column.
| | 02:34 | So this is just one way to help us
with our data input to see more than one
| | 02:38 | table's worth of data at that time.
| | 02:41 | We can input songs from the datasheet,
we can input songs from the datasheet
| | 02:45 | under the Performers table here, and of
course if we go to the Songs table and
| | 02:50 | double-click it, we can put
in new songs here as well.
| | 02:53 | So I'm just going to put one
in here in the Songs table.
| | 02:56 | Song ID is 1 by default.
| | 02:58 | I'm going to tab over to Song Title.
| | 03:00 | I'm going to type in More Than
a Feeling. The Genre is Rock.
| | 03:07 | The year that this came out was
1976, which would make it the 70s.
| | 03:12 | The Performer ID, I know just
from looking at the two tables is 1.
| | 03:16 | The Album ID is 1 and when I
hit Tab I'm on to a new record.
| | 03:19 | Now I'm going to go back to the Album
tab up here, and now I don't see that
| | 03:24 | updated field yet, or that updated
record in the Songs table until I refresh.
| | 03:29 | When I click the Refresh button notice that
that song now shows up in the sub datasheet.
| | 03:35 | Same thing if I go up to Performers
here and refresh, you can see I've got that
| | 03:40 | Song ID in there as well.
| | 03:42 | Of course Refresh All would just update
all of the tables and their sub datasheets.
| | 03:47 | So the sub datasheet is a great way to
see more information than just what's the
| | 03:51 | one table you're working in.
| | 03:53 | You can always see related information
in the related table, but you can also
| | 03:57 | use a sub datasheet to input new
data as well; keep that in mind.
| | 04:02 | Now we're only going to see
related information in a related table.
| | 04:06 | What if we wanted to input data
into all three tables at one time?
| | 04:10 | In other words have access to all of the
fields in all of the tables in our database.
| | 04:15 | Well that's where a query might come in handy.
| | 04:18 | In the next chapter, we're going
to dive into the topic of queries in
| | 04:22 | great detail.
| | Collapse this transcript |
|
|
6. Working with QueriesCreating a query using the wizard| 00:00 | Before we actually create our very first
query with a little help from Microsoft
| | 00:04 | Access using the Query Wizard, it's
important that you understand what the term
| | 00:08 | query means specifically in Microsoft Access.
| | 00:12 | Now, like the name implies, it's
kind of like asking a question.
| | 00:15 | In this case though with a relational
database, we'll be asking for information
| | 00:20 | from any or all of the Tables in your
database for example, or maybe we want to
| | 00:24 | create a New Table out of
information we pull from various other Tables.
| | 00:29 | Another option might be to find any
records that don't have matching records
| | 00:33 | in a related table, or on the other hand,
we may want to find Duplicates if they exist.
| | 00:38 | These are four examples of queries
that can be created using the Query Wizard
| | 00:43 | in Microsoft Access.
| | 00:44 | That's what we are going to do now.
| | 00:46 | You will notice up here on the
Title Bar I am using Music Library 6a.
| | 00:49 | So you can open that up from the
Lesson6 folder of your Exercise Files, and you
| | 00:54 | will be all caught up with me.
| | 00:56 | The next thing we need to do is click
the Create tab on the ribbon and over here
| | 01:00 | on the far right, you will notice in the
other section, we have got Query Wizard
| | 01:04 | and Query Design, two
different ways to Create queries.
| | 01:08 | We are going to focus-in, in
this lesson on the Query Wizard.
| | 01:11 | When I hover over it, you will see that
I can create Simple queries, Cross-tab,
| | 01:15 | Duplicates, and Unmatched queries.
| | 01:18 | Those are the four examples I just talked about.
| | 01:21 | So let's click the Query Wizard button.
| | 01:23 | This is a New Query and you will see
those four samples right here, Simple,
| | 01:27 | Crosstab, Find Duplicates, Find Unmatched.
| | 01:31 | Now, as I click on each one of these I
get a little bit of information over here.
| | 01:35 | The Simple Query Wizard is going to
help me create a select query, and that's
| | 01:40 | from the fields I pick from
the various tables or table.
| | 01:45 | Now, if I click on Crosstab Query,
you can see that this Wizard creates a
| | 01:48 | crosstab query that displays data
in a compact spreadsheet-like format.
| | 01:52 | So you create a new table out of your choices.
| | 01:56 | Find Duplicates Query Wizard, creates a
query that finds records with duplicate
| | 02:01 | field values in a single table or query.
| | 02:04 | So I can do queries on queries, and
Find Unmatched Query, this wizard creates a
| | 02:10 | query that finds records.
| | 02:11 | In other words rows in a table that
have no related records in another table.
| | 02:17 | So they'd be kind of like orphans.
| | 02:18 | Now, with Referential Integrity
turned on, we are not likely to find
| | 02:23 | any unmatched records.
| | 02:25 | So I am going to go back up to
Simple Query Wizard, and click OK.
| | 02:28 | So right away, you can see I have got
a drop-down in the Simple Query Wizard
| | 02:34 | screen here, step one where
I get to choose the table.
| | 02:37 | So if I click on for example Performers, I
will see the Fields in the Performers Table.
| | 02:44 | If I click on Songs, I see all of those Fields.
| | 02:48 | Now, I am going to choose the
Fields that I want to use in my query.
| | 02:54 | It's important to know here that I can
pick Fields from this Table, and then go
| | 02:58 | pick some more Fields from another Table.
| | 03:01 | So what I am going to do from the
Songs Table is choose Song Title.
| | 03:05 | I am going to click the
single arrow to move that over.
| | 03:07 | The double-arrow allows me to move
them all over if I wanted every single
| | 03:11 | Field in this Table.
| | 03:12 | But I just want Song Title right now,
and I am going to use the Performer ID.
| | 03:17 | Now, I am going to click the drop-down and
I am going to go to the Performers Table.
| | 03:24 | I would like to get the First Name
and the Last Name of the Performer.
| | 03:32 | When I click Next, I move onto the
next screen, and I get to name my query.
| | 03:37 | So I am going to leave the default in
there which is Songs Query, but you can
| | 03:41 | type whatever you like and then my
options down below are to Open the query to
| | 03:45 | view the information that's pulled
out, or to Modify the query design.
| | 03:50 | We are going to get into Query
Design in the next lesson and then further
| | 03:53 | modifications a little bit later
on in this title. So I am done.
| | 03:57 | I simply click Finish, and you can see what
happens here, I get all of my songs. Here they all are.
| | 04:03 | You can see the Performer ID
that was the Field I selected.
| | 04:07 | You can see the First Name and
the Last Name of the performer.
| | 04:11 | So if I come down here and I am just
going to double-click in between the
| | 04:14 | columns to adjust their widths to
accommodate the largest entry in each.
| | 04:22 | I come down here to Why Oh Why.
| | 04:26 | I see that that's Celine Dion. Her ID is 3.
| | 04:29 | Now, I may want to use this in something else.
| | 04:31 | The neat thing is that I can update
records using this query if I wanted to.
| | 04:37 | When I hit Tab at the end, in the last
Field here and hit Tab, you can see I can
| | 04:41 | type-in New Song Titles, IDs, First
Names and Last Names if I wanted to.
| | 04:46 | So I am not going to do that.
| | 04:47 | I am only going to use this query to
look at the information but that's a good
| | 04:51 | example of a simple query where we are
extracting information from one or more
| | 04:56 | tables, and bringing it
all together in one sheet.
| | 05:00 | So in the next lesson, we will look at
creating a query using the design method.
| | 05:05 | So from scratch, you have got a lot
more options at your fingertips, but it can
| | 05:10 | be a little bit more complicated.
| | 05:12 | Let's look at that next.
| | Collapse this transcript |
| Creating a query from scratch| 00:00 | When you're creating your queries in
Microsoft Access using the Query Wizard,
| | 00:04 | there may be times when you feel
somewhat limited by your options.
| | 00:07 | So we're going to look at
creating a query from scratch now.
| | 00:10 | In the previous lesson we used the
Query Wizard to create a simple Select
| | 00:14 | Query that goes in to one or more
tables, allows us to select the fields that
| | 00:19 | we want to display.
| | 00:20 | Here's the results right
here from the previous lesson.
| | 00:22 | You can see that we took some fields
from two different tables and we display
| | 00:26 | them in a datasheet.
| | 00:28 | Now, what if we want to do things
like filter out certain record and use
| | 00:31 | criteria to show only the information we need.
| | 00:35 | Here's the scenario.
| | 00:36 | We're giving an 80's party, so we want
to get a list of all the songs from our
| | 00:40 | database that are 80's.
| | 00:42 | So that's what we're going to now.
| | 00:44 | We're going to create this query from scratch.
| | 00:46 | This is the result from the previous lesson.
| | 00:48 | You can see I'm using Music
Library 6a from the exercise files.
| | 00:51 | We'll continue to use this particular database.
| | 00:55 | I just want to pop over to
Design View for a second now.
| | 00:57 | So I'm going to click the Design View
button and this is our Songs Query from
| | 01:02 | the previous lesson.
| | 01:03 | You can see we use two tables.
| | 01:05 | Then we've got fields from each of
those tables showing up down below, a
| | 01:09 | simple Select Query.
| | 01:10 | What you'll notice so is that
there is no sorting going on, we have a
| | 01:13 | Sort option down here.
| | 01:15 | There is no criteria set for any of
these fields, and that's we're going to do
| | 01:19 | by creating our query from scratch, we're going
to use some criteria, maybe even some sorting.
| | 01:23 | So, let's do that.
| | 01:25 | We'll go up to the Create tab and this
time we'll skip pass the Query Wizard
| | 01:30 | right over to Query Design.
| | 01:32 | We'll give it a click.
| | 01:33 | So right away, we're starting our new query.
| | 01:35 | Here's the Show Table dialog box.
| | 01:37 | It allows us to choose the
tables we want to use in our query.
| | 01:41 | Let's choose Songs.
| | 01:42 | So I'm going to click Songs and Add.
| | 01:45 | We may also want the performer name,
so I'm going to click Performers and
| | 01:48 | add that one as well. All right.
| | 01:52 | Now, all we need to do is get the fields
that we want to use down below into our
| | 01:57 | design area, so I'm going to close
this up, we're done selecting tables.
| | 02:01 | I'm going to take Song Title.
| | 02:02 | That's definitely information I'm going
to want, and drag it down into the Field
| | 02:07 | section down here and release.
| | 02:09 | You can see that the Field chose up
Song Title and the table it comes from also
| | 02:13 | shows up down below.
| | 02:14 | Now if I click in the next column,
you can see there is a dropdown.
| | 02:18 | If I click that, I'm going to see
all of the fields in each of the tables
| | 02:22 | showing up here as well.
| | 02:24 | So that's another way to get
a field into the right column.
| | 02:28 | So, I've already got Song Title, let's go
down to Performers and choose there First Name.
| | 02:34 | We also should have the Performers'
Last Name, if there happens to be one.
| | 02:38 | So another way to get that down
there is just to double-click Last Name.
| | 02:41 | You can see it
automatically fills in the next column.
| | 02:44 | So this is the information I want
displayed, but the field I want to set the
| | 02:48 | criteria on is actually not showing yet.
| | 02:52 | So I need to go back to my Songs table
here and I'm just going to stretch it out
| | 02:56 | so I can see all of the fields.
| | 02:58 | It's the Decade that I want to use.
| | 03:00 | So I am going to double-click Decade.
| | 03:01 | You can see it shows up down here, by
default, all of these fields will be
| | 03:05 | showing in the results.
| | 03:06 | I really don't need the Decade to show
though, I want to choose all of the 80's
| | 03:11 | music, but it doesn't have to say
80's all the way down to column.
| | 03:14 | I know it's going to be 80's music.
| | 03:16 | So I'm going to turn that
off by clicking the checkbox.
| | 03:19 | Now I'm going to set some criteria up.
| | 03:21 | So right here in the Criteria row under
Decade, I'm going to click in here and
| | 03:26 | I'm going to start building my criteria.
| | 03:28 | Now I could start typing here if I
know what I'm doing, if I don't, I can get
| | 03:32 | some help form the Expression Builder.
| | 03:34 | So I'm going to come up here to
the Builder button, give it a click.
| | 03:38 | There is my Expression Builder.
| | 03:39 | We saw this in a previous lesson.
| | 03:41 | Now all I want to do is set up the
Criteria, so that the Decade field from
| | 03:45 | the Songs table equals 80's.So I can
do that by coming down here to Tables
| | 03:50 | and double-clicking. That expands it.
| | 03:52 | We know that it comes from the Songs
table, so I'm going to double-click Songs.
| | 03:56 | That shows up now over here on the right.
| | 03:58 | Decade, I'm going to double-
click and look what happens here.
| | 04:01 | It gets inserted into my Expression Builder.
| | 04:04 | I can type in the Equal sign
now or select it from here.
| | 04:08 | So the Decade =, and I'm going to type in 80's.
| | 04:11 | When I click OK, I will have
written the actual Criteria.
| | 04:18 | Now the cursor is still flashing
here, if I want to continue entering
| | 04:22 | more criteria, I could.
| | 04:23 | I'm going to click down here.
| | 04:25 | You can see the full string that shows up.
| | 04:27 | Sometimes this part will get
hidden and just the 80's will show up.
| | 04:31 | That's the full Criteria as set
up by using the Expression Builder.
| | 04:37 | So, now I've got my criteria, I've got
the fields that are going to be displayed
| | 04:41 | in the results, all I have to do is run this.
| | 04:44 | When I click Run, you can see the results.
| | 04:48 | So here is the Song Title, there
is the First Name and the Last Name.
| | 04:52 | I know it's 80's, because in my Criteria,
if want to be sure, of course, I can
| | 04:57 | go back to Design View any time, I
can click the Show checkbox here under
| | 05:02 | Decade and run this again.
| | 05:05 | You can see sure enough, it's all 80's
down the right-hand side. All right.
| | 05:08 | I'm just going to double-click here in
between the columns to display all of the
| | 05:15 | information in full width.
| | 05:19 | There's my results from a Design
Query that I created from scratch.
| | 05:23 | Now, of course, it's very important
that we save our work, if we don't do that,
| | 05:30 | then we won't to able to go back
to this query whenever we need it.
| | 05:34 | Because, keep in mind, when we save
our queries as we update our songs tables
| | 05:38 | and our albums and so on over time
and they start to grow, we'll add more
| | 05:42 | 80's music, obviously, well, next time we run
the query, we'll see all of the new results.
| | 05:47 | So let's go up to the Save
button up here, we'll click Save.
| | 05:50 | You can see the default name showing up
is Query1 for me, I'm going to type in
| | 05:55 | 80's Music, and I'll click OK.
| | 05:59 | You can see it now shows up over here
under the Songs table as well as the
| | 06:04 | Performers table, because we're
using fields from both of these tables.
| | 06:08 | I'll always have access to the 80's
Music query just by double-clicking it, I'll
| | 06:12 | always see the latest results, and
over time, like I said, as we start adding
| | 06:16 | more music, the results will grow automatically.
| | 06:20 | So that's creating your own query from
scratch using the Design mode, of course,
| | 06:26 | the Query Wizard is another way.
| | 06:27 | Let's talk about how we go back and
make changes to a query, and we'll do
| | 06:31 | that in the next lesson.
| | Collapse this transcript |
| Modifying a query in Design view| 00:00 | By now you're starting to feel
comfortable designing your own queries either
| | 00:04 | using the Wizard or from scratch
like we did in the previous lesson.
| | 00:07 | Now we're going to look at going into an
already existing query design and make some changes.
| | 00:13 | So you can see up here at the top in
the title bar that I'm using Music Library
| | 00:16 | 6b from the Exercise Files.
| | 00:18 | So to get all caught up with me go
ahead and open that one up, and down below
| | 00:23 | you'll see that I have double-clicked
on 80s Music in the Performers table.
| | 00:27 | This is a query we
created in the previous lesson.
| | 00:29 | You can double-click it in the
Songs table or the Performers table to
| | 00:33 | display the results.
| | 00:34 | So now we've decided we're
going to make a change to this.
| | 00:37 | It might be nice to sort all of our
song titles perhaps, and maybe add in a
| | 00:41 | field and maybe some additional
criteria, maybe even change up the order.
| | 00:45 | So how do we do all that stuff?
| | 00:47 | Well we definitely want to go into
the Design View of the selected query.
| | 00:51 | So with 80s Music selected, we
go up to the Design View button.
| | 00:57 | So there we have down below, the
fields that are being used in our query.
| | 01:01 | There's the one that's not
showing, that's got the criteria.
| | 01:04 | So that 80s is the actual criteria
used for the decade in the Songs table.
| | 01:10 | If we wanted to add a new
field that's pretty simple.
| | 01:13 | We just find the field and one of the
two tables and add it by double-clicking
| | 01:17 | or dragging it down.
| | 01:18 | But what if we want to reorder things, so
just an example, the year that it came out.
| | 01:22 | I'm going to double-click Year Launched,
and you can see it automatically gets
| | 01:27 | added to the end here.
| | 01:28 | But maybe it belongs before
the actual first and last name.
| | 01:32 | So if I wanted to, you can see by
clicking just above Year Launched, I get that
| | 01:36 | arrow pointing down.
| | 01:37 | I can select the entire column.
| | 01:39 | With it selected I can click and drag
it until I see a line in between Song
| | 01:43 | Title and First Name, and release.
| | 01:46 | So there we have a re-ordered look at our query.
| | 01:50 | Now we're going to add some
criteria and some sorting options as well.
| | 01:53 | I'd like everything sorted
by the year that it came out.
| | 01:57 | So in the Sort row over here, I'm going
to slide over to Year Launched and click
| | 02:01 | in the blank field which
displays this drop-down for me.
| | 02:04 | When I click that I can say
Okay, Ascending or Descending.
| | 02:07 | I'm going to choose Ascending.
| | 02:10 | And now if I was to run the results
here, I'd have the new field and the new
| | 02:13 | sort option in there as well.
| | 02:15 | But what if I want to change this
query to include 70s music as well.
| | 02:19 | Of course I'm going to have to rename the
query to 70s and 80s Music, not just 80s Music.
| | 02:24 | Let's go down here and you'll notice
that under 80s, I've got an or field, and
| | 02:29 | I'm going to click in there.
| | 02:30 | And I could use the Expression
Builder if I wanted to to add in some new
| | 02:34 | criteria where decade could also equal
the 70s, or I can just type in the way I
| | 02:40 | see it up here and that is in double
quotes, to type in 70s, just like that.
| | 02:45 | All right I'm going to
click outside, looks good.
| | 02:49 | I should be able to run this
query now to see the results.
| | 02:52 | That's what I'm going to do.
| | 02:54 | Clicking the Run button shows me the results.
| | 02:56 | You can see the year that these
songs came out, and that's the order
| | 03:00 | that they're sorted.
| | 03:01 | So from the oldest to the newest, and
then you can see that I've also got all of
| | 03:07 | the other fields that were selected.
| | 03:09 | The one that's not showing is the Decade,
cause we chose not to show that but it
| | 03:13 | is being used for the criteria.
| | 03:15 | So I'm getting 70s and 80s music now.
| | 03:17 | Of course the name of this query is 80s
Music, so it really doesn't make sense.
| | 03:23 | I either have to rename this query to
something else by using Save As, or if I
| | 03:28 | wanted to I could go back
and take the 70s part out.
| | 03:32 | That's what I'm going to do.
| | 03:32 | I'm going to go back to Design View,
and I no longer want the 70s criteria.
| | 03:37 | It doesn't make sense for this query.
| | 03:39 | Let's simply highlight it by clicking and
dragging and hitting Delete on the keyboard.
| | 03:44 | All right, when I run it, the new
results are only 80s songs, but still sorted
| | 03:50 | by the year, and now I'm
ready to save my changes.
| | 03:54 | Coming up to the Save button and
clicking Save is going to save all those design
| | 03:57 | changes I made so this query is now up to date.
| | 04:00 | Keep in mind, again now as we start
adding more albums, more songs, more
| | 04:05 | performers, any of the ones that are
80s that get added to our various tables
| | 04:10 | will show up in this query every time we run it.
| | 04:13 | So the results should grow over time.
| | 04:16 | Now later on we're going to be talking
about forms, and forms are the best way
| | 04:19 | to input data, to be able to input data
into more than one table at one time and
| | 04:25 | to force people to input certain kinds
of data and so on by giving them options.
| | 04:29 | We'll talk all about that when we get to forms.
| | 04:32 | For now let's just check out the
results of our query, be happy with that, make
| | 04:37 | sure we save our changes before moving on.
| | Collapse this transcript |
| Performing calculations on a group of records| 00:00 | As you run Queries in Microsoft Access,
it may be useful on occasion to get a
| | 00:05 | running total of the number of
records that are returned in a Query.
| | 00:09 | For example here where we been
running our Query called 80s Music in the
| | 00:13 | previous lesson, it might be nice to
see a total number of records that have
| | 00:17 | been returned from our database based
on some criteria that we set earlier on.
| | 00:21 | And we can go down to the status bar down here
and see that we're at record 1 of 9 for example.
| | 00:26 | So there's a total of 9
records returned in this Query.
| | 00:30 | But what if we want the total to show
up maybe down here in the bottom row, so
| | 00:33 | when we print the results we've got
that total showing up right there.
| | 00:37 | It's pretty easy to do, and
I'm going to show you how.
| | 00:39 | First of all, I'm using Music Library 6c.
| | 00:43 | So go ahead and open that one up from
your Exercise Files if you've got it and
| | 00:47 | you'll be all caught up.
| | 00:48 | I've double-clicked on the 80s Music
query, so that's what you're seeing over
| | 00:52 | here on the right-hand side, the
results of the 80s query, and if I go over to
| | 00:57 | the Design View by clicking the Design
View button here, you'll see that the
| | 01:01 | criteria under the Decade column is
that we want all the songs where 80s shows
| | 01:07 | up in the Decade field.
| | 01:10 | So when we run this or switch to
Datasheet View, we see those results.
| | 01:13 | What we don't see is a total, and the
total can show up at the very bottom
| | 01:17 | here, simply by clicking the Totals button
up here in the Records section of our ribbon.
| | 01:22 | So when I click on Totals, you'll see
that the word Total shows up here in
| | 01:26 | the first column, and now I just simply have
to select the field that I want to total up.
| | 01:31 | In this case it really doesn't matter
which one I choose, because I'm going to
| | 01:34 | get a running total or account of
all the records that show up here.
| | 01:39 | So I'm going to click right in here
next to Total, under the Year Launched
| | 01:44 | column, and I'm going to click the drop-down
and you can see my options here are None or Count.
| | 01:48 | Now if it was a numeric field I might
be able to sum up numbers for example, if
| | 01:53 | I wanted to or average them out, but
here I'm going to click Count, and right
| | 01:57 | away you can see the number 9 shows up.
| | 02:01 | So I'm going to click over here in
another field so you can see that total.
| | 02:06 | Now if we don't want the Totals row, no problem.
| | 02:09 | We just click the same button,
Totals button to turn it off.
| | 02:12 | The next time we turn it back on
everything we set up earlier is still there, so
| | 02:16 | we do see a running total of 9
records in our 80s Music query.
| | 02:21 | So that's all there is to running Totals.
| | 02:24 | Now we can get deeper into
totaling up columns and groups and so on.
| | 02:29 | We'll do that later on when we get into
reports, and those reports can be based
| | 02:34 | on a query that we set up.
| | Collapse this transcript |
| Creating flexible queries| 00:00 | It's time now to have a little bit of
fun by adding flexibility to our queries,
| | 00:05 | and it'll be easier for me to explain
this if we look back at our previous
| | 00:09 | scenario where we did create an actual
query called 80s Music, and based on some
| | 00:15 | criteria, it brought back all the songs
in our library that were considered 80s.
| | 00:20 | How did we do that?
| | 00:21 | We set up criteria in the actual
Decade field from the Songs table.
| | 00:25 | It had to equal 80s, and
you can see what happens.
| | 00:28 | Now if we wanted to see a list of all
of our 70s tunes, we would do another
| | 00:32 | query perhaps where the
decade would have to equal 70s.
| | 00:35 | And the same thing again
for 60s and the 90s and so on.
| | 00:39 | So you can see we could end up with a
lot of queries down the left-hand side
| | 00:43 | here in our Navigation Pane, but
another option is to create something called a
| | 00:47 | Parameter query and that's where the
user gets to input the criteria on the fly.
| | 00:52 | So each time you run the query, you
enter the new criteria and the results are
| | 00:57 | different each time.
| | 00:59 | So let's create a Parameter query now.
| | 01:01 | It's very important though if you're
following along and you have the Exercise
| | 01:04 | Files, to open up Music Library 6d.
| | 01:07 | What I've done is I've added some
additional records, so if you want to be up to
| | 01:11 | date, open up this one before you continue.
| | 01:14 | Next we're going to go to the
Create tab to create a brand-new query.
| | 01:18 | We're going to do it from scratch so
we come over here into the other section
| | 01:21 | and click Query Design.
| | 01:23 | All right let's choose a
different scenario here.
| | 01:26 | Let's say we want to be able to show a
list of all of our rock songs, or all
| | 01:32 | of our pop songs, or maybe whenever we need
to show a list of all of our holiday songs.
| | 01:36 | We're going to set up a Parameter Query
that's going to prompt us for the Genre.
| | 01:40 | So that's important to know ahead of
time, when we select the tables that we're
| | 01:44 | going to use in this query.
| | 01:46 | So we definitely want the Songs table
cause we want to be able to display the
| | 01:49 | songs and it might be nice to show who
performs those, so let's double-click
| | 01:53 | Performers to add that table,
and that's really all we need.
| | 01:57 | We've got the Genre field over here
that we can base our criteria on, and all
| | 02:01 | the other information we want displayed.
| | 02:03 | So I'm going to click Close over here on
the Show Table dialog and now I'm going
| | 02:07 | to choose some fields that I
want displayed in the results.
| | 02:11 | I definitely want the Song Title.
| | 02:12 | I'm going to add the Decade.
| | 02:16 | I also want to see the Performers
first name and last name if there is one.
| | 02:22 | So all of these results will be
shown or displayed in the end result.
| | 02:26 | But I want to base criteria on the Genre.
| | 02:29 | So I'm going to double-click Genre over
here, which adds it to the grid down below.
| | 02:33 | But I'm going to base the criteria on this one.
| | 02:35 | I don't necessarily need it to show up
in the results, so I'm going to deselect
| | 02:40 | the check box in the Show section, and
down below in Criteria, instead of typing
| | 02:45 | in equals rock or pop, I'm going to
actually put in a message here for someone
| | 02:50 | to enter that information, and
it has to be in square brackets.
| | 02:53 | So I start with the left square bracket.
| | 02:55 | I'm going to type in
| | 02:57 | [Please type in a genre and I'm going to close it up with the right hand square bracket,
and that's the message that will appear every time I run this query.] Let's test it out.
| | 03:10 | We'll go up to the Run button here. (ph)
| | 03:12 | I'll click Run, and look at that,
a little dialog box appears saying,
| | 03:16 | Please type in a genre.
| | 03:18 | I'm going to type in Rock,
and I'm going to click OK.
| | 03:22 | And you can see the results.
| | 03:24 | There's the Song Title, the Decade,
First Name and Last Name if there is one,
| | 03:28 | and all of this would be
considered rock music based on the genre.
| | 03:32 | Okay let's go back to the Design View.
| | 03:35 | Again, we just entered the
message in square brackets.
| | 03:39 | If we run it again by the way, we
can enter in a different criteria.
| | 03:43 | How about holiday music?
| | 03:45 | When I click OK, I get all the songs
that would be considered holiday music.
| | 03:51 | Obviously you're going to have
to type in a genre that exists.
| | 03:55 | So you have to know a little bit of,
about the information in your tables.
| | 03:59 | If you enter genre that doesn't exist,
of course you won't get any results.
| | 04:03 | Now, once we get into forms a little
bit later on and reports, we can take this
| | 04:07 | to the next step, and force people
to enter valid data, valid options.
| | 04:12 | But we'll save that for later.
| | 04:13 | Right now let's continue
with another Parameter Query.
| | 04:16 | So I'm going to save this one.
| | 04:18 | I'm going to call it Query by Genres, so
I'm going to take out the 1, and click OK.
| | 04:27 | Let's create another one and this
time we're going to use two values.
| | 04:31 | So we're going to go over to our Query
Design, and let's say we want to be able
| | 04:34 | to show a list of songs between certain years.
| | 04:37 | So definitely we need the Songs
table and that might be all we need.
| | 04:41 | So we'll close this up.
| | 04:42 | Now we want to see the Song Title, and
we want to use the year that it came out
| | 04:50 | as the Criteria field.
| | 04:53 | So down below, we don't need to show
the actual year it was launched, but we do
| | 04:59 | want to put in the criteria, and
this time it's going to be two options.
| | 05:03 | So two boxes will show up.
| | 05:05 | We're going to use greater than, so we put in
the greater than sign, and then the message.
| | 05:12 | So again in square brackets:
| | 05:23 | Enter a start year, and then we close that up with a
square bracket, then we put in the operator, which is and. (ph)
| | 05:23 | So greater than and less than, and
then we'll put in square brackets:
| | 05:35 | Enter the end year and some
more square brackets. (ph)
| | 05:36 | Okay, so if we run this,
let's see what it looks like.
| | 05:41 | Enter a start year.
| | 05:42 | I'm going to put in 1970
and I'm going to click OK.
| | 05:47 | Right away another one shows up.
| | 05:49 | Enter the end year.
| | 05:50 | I'm going to put in 1990, and when I
click OK, I see a list of all the songs.
| | 05:57 | I'm just going to double-click
here on the right to expand that.
| | 05:59 | All of these songs fall between 1970 and 1990.
| | 06:02 | Let's go back to the Design View, and
just to prove it, we're going to add in
| | 06:08 | the Year Launched, which is already here
and click Show, and we'll run it again.
| | 06:15 | Again we're prompted we can put in
different values or the same values.
| | 06:19 | When we click OK, we see the results
and we show the year that it came out.
| | 06:28 | Every one of these numbers
falls between 1970 and 1990.
| | 06:32 | Notice it's not really sorted in any way,
so again we could go back to the Design View.
| | 06:38 | You could say sort by the year in
ascending order, and let's run it one more time.
| | 06:45 | We'll type in some different criteria this time.
| | 06:47 | How about 1980 as the start
year and 2000 as the end year.
| | 06:56 | So all of these now fall between 1980 and
the year 2000, and you can see they (ph)
| | 07:01 | are sorted by year as well.
| | 07:04 | So this is one we would want to save.
| | 07:06 | This one would be actually a
Query by Year. We click OK.
| | 07:11 | We've now got more than one query in here.
| | 07:13 | You can see they show up in
my Navigation Pane as well.
| | 07:17 | And that's just an example of using a
Parameter Query to add flexibility to your
| | 07:21 | queries to display the results
you need each and every time.
| | Collapse this transcript |
|
|
7. Working with FormsIntroduction to forms| 00:00 | It's time now to discuss Forms in
Microsoft Access and the advantages of using
| | 00:05 | Forms in your database.
| | 00:07 | To this point, we've worked with Tables
and Queries and another type of object
| | 00:13 | in Microsoft Access is the Form.
| | 00:15 | Now, I want you to think for a moment
if you've ever signed up for anything
| | 00:18 | online, where you're prompted for your
information, maybe it's an e-newsletter
| | 00:22 | or a membership of some kind.
| | 00:24 | You're prompted for your own
personal information you enter it into the
| | 00:27 | appropriate fields, and you're only
allowed access to that information.
| | 00:31 | So that's one of the advantages of using a form.
| | 00:34 | An Online Form is attached to some kind
of database in the background where your
| | 00:39 | information is stored in tables
like we see here in Microsoft Access.
| | 00:43 | The other advantage to Forms is that
it makes it easy for the user to input
| | 00:47 | information, edit existing information,
and view any information that they
| | 00:52 | should be allowed to view.
| | 00:53 | Of course, you can hide the information they
should not be viewing as well, by using a Form.
| | 00:58 | So, so far we've been entering
data straight into the table.
| | 01:01 | We see all of the fields in that
table, and all of the records of course.
| | 01:06 | Well, with a Form, we can restrict that.
| | 01:09 | So what we're going to do in this
chapter is look at the different ways that we
| | 01:12 | can create Forms in Microsoft Access.
| | 01:14 | There's a built-in wizard to help us along.
| | 01:16 | Of course we can go straight to Design
View and create our Forms from scratch.
| | 01:20 | Even then Access is going to give
us a helping hand along the way.
| | 01:24 | And then we're going to look at some
more detailed functions like adding
| | 01:28 | sub-Forms, a Form within a Form, and
Command buttons, Split Forms, and the like.
| | 01:33 | You'll notice here that I've got a
database opened and if I look at the Title
| | 01:37 | Bar, its Acme2007a, this is
the one we're going to use.
| | 01:41 | It's a brand new scenario now
where we've got a customers table with
| | 01:45 | customer information in it.
| | 01:46 | Customers will be placing orders, so we
see an Orders Table and then of course
| | 01:52 | what are they ordering?
| | 01:53 | Well, products from the Products Table.
| | 01:55 | So we'll start in the next lesson by
using the Form Wizard to create a brand new
| | 02:00 | form that allows us to enter products
into the Products Table and review, and
| | 02:04 | edit that information as well.
| | Collapse this transcript |
| Creating forms with the Form wizard| 00:03 | It's time to create our first Form in
Microsoft Access and we are going to use
| | 00:06 | the Form Wizard to do it.
| | 00:09 | You can see here I have got Acme2007a opened.
| | 00:12 | It's from the Lesson 7
folder of the Exercise Files.
| | 00:16 | So if you want to follow along and you
have got the Exercise Files, go ahead and
| | 00:19 | open up this database.
| | 00:21 | I am currently in the Relationships view
right here, so you can see that we have
| | 00:25 | got three tables
Customers, Orders, and Products.
| | 00:28 | You can see the primary key
over here in the Customers table.
| | 00:31 | There is the Customer ID,
which shows up in my Orders table.
| | 00:35 | Hopefully, it shows up in the Orders
table many times if I want to stay in
| | 00:38 | business and then you can see in the
Products table here, I have got a Product
| | 00:41 | ID and the Name, Unit Price, and
Description, and this will show up many times
| | 00:46 | in the Orders table as many customers will order
this product over and over. We hope of course.
| | 00:52 | Now, the Order Number in the Orders
table is also a primary key, so we can keep
| | 00:56 | track of all of our orders.
| | 00:58 | The reason that we are going with this
new scenario, you can see we have got a
| | 01:01 | Unit Price now and there is a
quantity in the Orders table.
| | 01:04 | We may want to be doing some
calculations with this data a little bit later on.
| | 01:08 | So we change scenarios here to
something a little more professional.
| | 01:12 | So the next step is to create a Form that a
user will actually make use of to enter products.
| | 01:18 | So to either edit existing products,
review the products in the Products Table,
| | 01:22 | or add new products as they come along.
| | 01:25 | So what we are going to do first is
come over to the Navigation Pane here and
| | 01:29 | you can see All Tables is selected.
| | 01:31 | So make sure that All Tables is selected here.
| | 01:34 | We are going to start with the Products
table, so it is a good idea to select it
| | 01:38 | first before going up to the Create tab
here on the Ribbon and we are going to
| | 01:43 | create a Form, so we are going
to be in the Forms section here.
| | 01:45 | You will notice there is nothing that
really shows up here that says Form Wizard.
| | 01:49 | It is kind of hiding over here under More Forms.
| | 01:52 | So we can create a basic Form.
| | 01:54 | This is a Form that will of course let you
enter information for one record at a time.
| | 01:59 | There is something called the Split Form.
| | 02:01 | We are going to look at
this a little bit later on.
| | 02:03 | It is kind of a Datasheet View, and there is
two sections, an upper and a lower section.
| | 02:07 | We have got Multiple Items, which is
kind of like a Datasheet View with a table.
| | 02:12 | And then there is our Form Design button
that we will look at in the next lesson.
| | 02:15 | For now we are going to go to the
Form Wizard to get it started and it is
| | 02:19 | hiding under More Forms.
| | 02:20 | So we will click on the Form Wizard and you
can see the Form Wizard dialog box launches here.
| | 02:27 | The Table called Products is already
showing up here, because we selected it
| | 02:31 | ahead of time from our Navigation Pane.
| | 02:33 | Now, you can see the fields
that are available in this table.
| | 02:36 | So remember what I was saying earlier
that we can restrict what information can
| | 02:41 | be viewed or edited or
even entered by using a Form.
| | 02:45 | Well, we can use any or all
of these fields in our Form.
| | 02:48 | Now, for our purposes we do want them all.
| | 02:51 | So I can click this double arrow to move
them all over to the Selected Fields box.
| | 02:56 | I am ready to move on. I click Next.
| | 02:59 | Now, we can choose a look for our Form and
you can see by default, we have got Columnar.
| | 03:03 | So we have got columns of data showing up here.
| | 03:06 | Tabular is more like the Datasheet View.
| | 03:09 | So as Datasheet, similar to what
we are used to seeing in our Tables.
| | 03:14 | And then we have got something called
Justified, which kind of formats our
| | 03:17 | fields around the screen.
| | 03:19 | So let's go back to the first
one Columnar and we will hit Next.
| | 03:24 | Now, we are going to choose a style.
| | 03:25 | So we can go through the styles and see
a little preview over here on the left
| | 03:29 | of what that style looks like.
| | 03:30 | Some nice looks and there is quite a long list.
| | 03:35 | You can see as we scroll down.
| | 03:37 | There is lots to choose from.
| | 03:40 | I am going to go down to Windows
Vista down here and click Next.
| | 03:45 | Now, we can give our Form a title.
| | 03:47 | So Products is showing up here
because it is using the Products table.
| | 03:50 | That's probably just fine.
| | 03:52 | You can add text, change what is there by
highlighting and typing over. It is up to you.
| | 03:56 | I am going to leave the default of
Products in there and that's all the
| | 04:00 | information that the Wizard actually needs.
| | 04:01 | Do we want to open the Form
or modify the design next?
| | 04:05 | And you can see by default, Open
the Form to view or enter information
| | 04:08 | is already selected.
| | 04:10 | If we want to go further and modify
the Form's design, so we are not exactly
| | 04:14 | keen on what the Wizard has given us,
we can go in and modify that design, but
| | 04:18 | we can do that anytime.
| | 04:19 | So for now, we will leave it at Open
the Form to view or enter information,
| | 04:23 | we will click Finish.
| | 04:26 | So now you can see that we are
actually in the Products Form.
| | 04:29 | I have got a tab here.
| | 04:30 | The Relationships tab is still there.
| | 04:32 | Well, we are in the Products Form.
| | 04:33 | We are seeing one record per screen.
| | 04:36 | So Product ID number 1 is a 12 inch LCD monitor.
| | 04:39 | You can see the price and the description.
| | 04:41 | Now, we can move around
through these various records.
| | 04:44 | Down at the bottom of the Form, you
can see on the Status Bar we have got
| | 04:48 | Navigation buttons to take us to the
next record and we can move through the
| | 04:52 | records like that if we see
something that needs to be changed.
| | 04:55 | We can just go in and change it.
| | 04:57 | We can go right to the very end, the
last record or back to the very beginning
| | 05:02 | using the first record button.
| | 05:04 | If we want to enter something new, we come
over here to that New Blank Record button.
| | 05:10 | The Product ID, if we try to type
something in here, you can see nothing happens.
| | 05:15 | It's because it's an auto number field.
| | 05:17 | It's automatically going
to increment for us by 1.
| | 05:20 | So we can tab into the Product Name.
| | 05:23 | Here is where we give our product a name.
| | 05:25 | So let's actually enter something here.
| | 05:27 | We will enter a piece of
computer equipment. Let's do Scanner.
| | 05:36 | Unit Price, we'll put it in at $49.99
and when we hit Tab, see how it changes
| | 05:42 | to a Currency field.
| | 05:43 | That's because that was set up in the
Table and in the Description we will put,
| | 05:46 | USB Flatbed Scanner.
| | 05:50 | There we go.
| | 05:56 | Hitting Tab will take us to another new record.
| | 05:58 | We don't need to enter anything at
this point, but you can see now we are up
| | 06:01 | to 12 records down at the bottom and
that's thanks to the Form we were able to
| | 06:05 | enter that new record without looking at
the entire table and the entire datasheet.
| | 06:10 | So that's a very simple Form using an
existing table and making use of the Form
| | 06:16 | Wizard to create it for us.
| | 06:17 | In the next lesson, we will create a
similar Form, but we will do it from
| | 06:21 | scratch using Design view, and then we
will take it a step further with some
| | 06:24 | more design elements.
| | Collapse this transcript |
| Creating forms from the Design view| 00:00 | Well we saw in the previous lesson
just how easy it is to create a brand new
| | 00:04 | form in Microsoft Access, with a
little help from the Form Wizard.
| | 00:08 | Now we are going to go about creating
a form a different way that by the way
| | 00:11 | is equally as easy.
| | 00:12 | We are going to base it on
a different table though.
| | 00:15 | So the first thing if you are
following along and you skipped to this lesson,
| | 00:18 | you will need to open up the Acme 2007b:
| | 00:21 | Database from the lesson_07
folder of your exercise_files.
| | 00:24 | The next thing you are going to do is
click on the table that we are going to
| | 00:28 | create the form from.
| | 00:30 | So I am going to click on the Customers:
| | 00:31 | Table over here in the Navigation Pane.
| | 00:34 | That's important before clicking the
Create tab and going to Forms section, you
| | 00:38 | want to have the right table selected,
because the form you create using this
| | 00:42 | method will be based on the selected table.
| | 00:45 | Now here are the Form buttons.
| | 00:46 | You can see we've got a Form button
here and this is going to create a very
| | 00:49 | simple form similar to the one we have
down below that was created using the wizard.
| | 00:54 | It lets us enter
information one record at a time.
| | 00:56 | A Split Form, we are going to talk
about a little bit later on is kind of cool
| | 00:59 | because, the form actually shows up at
the bottom of the screen and then there
| | 01:03 | is a data sheet in the upper section so
that we can actually enter information
| | 01:08 | about the selected record
in the related data sheet.
| | 01:11 | Multiple Items is similar to a Data
Sheet View, I am actually going into the
| | 01:15 | table and entering records or information,
except that with a form, we can limit
| | 01:20 | the fields that show up in this view.
| | 01:21 | We can create a blank form right from
the scratch and a little bit later we will
| | 01:26 | go back to the Form Design to make
some changes to an existing form.
| | 01:30 | We access the Form Wizard,
from the More Forms button.
| | 01:33 | So now we are going to use one of these
three options, we are going to go to the
| | 01:36 | very first one Form, and with the Customers:
| | 01:38 | Table selected when we click
the Form button, watch this.
| | 01:41 | It's very quick, the Customers form has
been created and it's based on the Customers:
| | 01:47 | Table and its relationship.
| | 01:50 | Look down at the bottom here.
| | 01:51 | You can see we have got all of the
customer information listed here, and then
| | 01:55 | down at the bottom, we have got a data sheet
of the related table which is the Orders: Table.
| | 02:00 | So I can see customer information in here,
and order information for that customer.
| | 02:06 | Now if the customer doesn't have any
orders this will be blank down below.
| | 02:10 | But I can actually enter orders right from
the customers form as well as add new customers.
| | 02:15 | It's kind of interesting.
| | 02:17 | The other thing that's happened here is
that we are brought directly into what's
| | 02:20 | called Layout View, and we can
change the layout of our dorm now.
| | 02:24 | So unlike the Wizard, we don't get to
choose a style, we didn't get to choose an
| | 02:29 | actual layout but we can
make changes ourselves now.
| | 02:32 | If we wanted to for example,
move these fields around, we can.
| | 02:35 | You can see there is a little four-sided
arrow up here and when I click on it,
| | 02:39 | all of those fields get
selected and I can move that up.
| | 02:41 | For example, if I want to bring it
little higher towards the top and leave more
| | 02:45 | space between it and my data sheet and
then I have got all of these options up
| | 02:49 | here for changing the fonts, the appearance,
the sizes and even the alignment if I wanted to.
| | 02:56 | Over here in Formatting if I click in
one of these fields, you can see I can
| | 03:00 | format the field, if it should be, for example,
down here a Currency Format, I could do that.
| | 03:06 | Here's number, a zip code.
| | 03:07 | Notice that the Formatting
disappears if it's not a numeric field.
| | 03:11 | If I come up here to the Customer ID, I
can't change the Formatting, I can add
| | 03:16 | Gridlines, I can put in a Logo,
I can add a title to this form.
| | 03:21 | You can see Customers is the default
here, based on the name of the newly
| | 03:26 | created form, now it hasn't been saved yet.
| | 03:29 | You will notice it doesn't show up over
here in the Navigation Pane until we save it.
| | 03:32 | There's all kinds of
things, including Auto Format.
| | 03:34 | I am going to click on this first one,
in Auto Format and this is an Access 2003
| | 03:40 | Format that you are looking at here.
| | 03:42 | If I go over to the other one, it's an
Access 2007 Format and that's what was
| | 03:47 | created by default for me.
| | 03:48 | And we are going to get into formatting
and modifying the design of your forms
| | 03:52 | and so on, but for now we
have got our brand new Customers:
| | 03:55 | Table, we are in Layout View.
| | 03:57 | To change to another view we
can go to the View button here.
| | 04:00 | Click on Form View and this is the view
that we would use to actually view our
| | 04:05 | data, edit existing data or even come
down here and add new data, if we wanted
| | 04:10 | to add new records for example.
| | 04:11 | As soon as new customers come on board,
we can enter them using this form.
| | 04:15 | Now all of the rules that apply to
the underlying table apply in the form.
| | 04:20 | So if we set up any validation rules
for examples in a table, then they will
| | 04:25 | exist here as we enter data into the form.
| | 04:28 | So let's save our changes and
go up to the Save button up here.
| | 04:33 | By default the name is Customers as
the Form Name, because it's related to
| | 04:36 | the customers table.
| | 04:38 | That's fine with me, so I am going to click OK.
| | 04:40 | And you can see now that the
Customers form does show up over here on the
| | 04:43 | left-hand side on the Navigation Pane.
| | 04:46 | So another extremely easy way to create a form.
| | 04:50 | It's a quick and dirty format.
| | 04:51 | So if we need to make changes and
change up the design or the layout, we can do
| | 04:55 | that and that's exactly what we
are going to do in the next lesson.
| | Collapse this transcript |
| Modifying a form's design| 00:00 | Now that you are comfortable with a
couple of different methods for creating
| | 00:03 | forms in Microsoft Access, we are going to
look at modifying the design of an existing form.
| | 00:10 | When we created the form in the
previous lesson or even when we used the form
| | 00:14 | wizard, there were a couple of options
at our disposal for selecting the way our
| | 00:18 | form was going to appear, but there was
not a lot of flexibility built into the
| | 00:22 | actual design process of the form.
| | 00:25 | We accepted many, many defaults.
| | 00:27 | For example, here this Customers form you
can see has the word Customers in the title.
| | 00:31 | That's based on the table customers.
| | 00:33 | The logo is simply the icon
that Access users were form.
| | 00:38 | Then down below you could see
the fields in the detail section.
| | 00:42 | Automatically this table was added for
us at the bottom and there is nothing
| | 00:46 | really else past that except for the
navigation buttons for moving through
| | 00:50 | the different records.
| | 00:51 | All right, so what if we want to change
up this design, maybe improve upon it.
| | 00:57 | No, problem all we need to do is
change the view to Design view.
| | 01:01 | That's what we are going to do right now.
| | 01:03 | You will notice up here in the title bar,
I am using a database called Acme2007c
| | 01:07 | from the Lesson07 folder of the Exercise Files.
| | 01:10 | So if you are jumping to
this lesson, no problem.
| | 01:13 | You can open that one up and double-click
the Customers form and switch to
| | 01:17 | the actual form view.
| | 01:20 | Now if you have been following along in
the previous lessons and you are in the
| | 01:23 | right spot, you can just
continue working on the existing form.
| | 01:26 | All we are going to do now is improve
upon the design of our Customers form by
| | 01:30 | going up to the View button up here on
the ribbon, click the dropdown, we are
| | 01:34 | going to change from Form View to Design View.
| | 01:37 | As soon as we do that, you
can see some things happen.
| | 01:40 | First of all, we have got sections, we
have got a Form Header and in the header,
| | 01:44 | we have got our logo and our title so far.
| | 01:46 | We've got a detail section containing
the fields that are used in our form.
| | 01:51 | Obviously, they relate
back to the Customers table.
| | 01:53 | There is the Orders table that was
inserted for us and there is also a Form
| | 01:58 | Footer section down below.
| | 01:59 | You will notice a ruler down the left
hand side, a vertical one as well as a
| | 02:04 | ruler across the top and this will help
us when we are trying to line objects up.
| | 02:08 | All right, I am going to scroll all
the way back up to the top and show you
| | 02:13 | what's happening on the ribbon as well.
| | 02:14 | Now as soon as we change to Design View,
you can see the Form Design Tools area
| | 02:20 | is shaded up here in the title bar and I
have got two tabs that fall under that,
| | 02:24 | Design and Arrange and each of these
tabs contains a number of Tools to help me
| | 02:29 | with the modification of
the design of this form.
| | 02:33 | On the Design tab, you can see I have
got Font Options, Gridlines, then I have
| | 02:39 | got Controls here, all kinds of things
that can be added including logos, text
| | 02:44 | boxes, buttons that we are going to
talk about later on, graphics and so on.
| | 02:48 | We have also got Tools over here on the
right hand side to add existing fields
| | 02:53 | and look at the property sheet, etcetera.
| | 02:55 | Now if we go to the Arrange tab, you can
see we have got a number of things here
| | 02:58 | including AutoFormat that might come in handy.
| | 03:01 | We can change the layout here, we have
got Control Layout altogether, so some
| | 03:06 | built-in options for us,
Tabular, Stacked, Remove.
| | 03:10 | We have got Control Margins and Padding,
Snapping to the grid, changing the tab
| | 03:15 | order, all kinds of things.
| | 03:17 | We can control alignment, size, position
and we have got some Shows/Hide buttons
| | 03:24 | as well, to show rulers or
item, gridlines, etcetera.
| | 03:27 | I am going to start with the Design tab and
we are going to start with our Form Header.
| | 03:33 | Here we have the logo that was
created for us and it's simply the icon that
| | 03:37 | represents a form in Microsoft Access.
| | 03:39 | We are going to change that and the
easiest way to change a logo is just to
| | 03:42 | click the Logo button right here.
| | 03:44 | You can see it highlighted the
logo and then it took us to the Insert
| | 03:49 | Picture dialog box.
| | 03:50 | All we need to do now is go and find
our logo and I am going to that now, I am
| | 03:55 | going to go to my Exercise Files, so
you we can do the same, double-click the
| | 04:00 | Lesson07 folder and you will see
a logo in there that we can use.
| | 04:04 | It's a capital letter A. We will click OK.
| | 04:08 | So the old logo is replaced with the new.
| | 04:10 | I am going to size it by going to one
of the sizing handles here, I am going
| | 04:14 | to make it larger just like so and now I am
going to change up our title area as well.
| | 04:20 | Customers is fine, but I
want to add a little bit.
| | 04:23 | As soon as I click in this area, you
can see now it's highlighted, the logo is
| | 04:26 | no longer highlighted, and I can click
inside here, right before Customers and
| | 04:31 | just type in Acme like so.
| | 04:36 | When I click outside that area, it's
locked in and you can see I have already
| | 04:40 | made some nice changes to the design of my form.
| | 04:44 | Now if we look over to the right and
use the scrollbar down at the bottom to
| | 04:48 | scroll over to the right, its fields
are very wide, so is this area up here,
| | 04:53 | come to Title and if we scroll down, a
table called Orders that was inserted for
| | 04:58 | us also goes to the very edge of the form.
| | 05:01 | We can change the size of our form and
to do that, we need to change the size of
| | 05:06 | our fields and so on, all of
the objects inside the form.
| | 05:09 | I am going to start down here by
clicking on the table called Orders and as soon
| | 05:13 | as I can see this little handle over
here and I get the double arrow, I can just
| | 05:17 | drag it inwards to make it a little bit smaller.
| | 05:19 | I don't need it to be that wide.
| | 05:21 | I am going to go to the 6-inch
mark and I am going to scroll up now.
| | 05:24 | Now all these fields are related, so
when I click in anyone of them and I drag
| | 05:29 | the right hand border into the 6-inch
mark, all of them move in. That's handy.
| | 05:34 | I am going to scroll up.
| | 05:37 | Click on this Title area and do the
exact same thing when I see the double
| | 05:40 | arrow, drag it into the 6-inch mark.
| | 05:44 | That means now that I can
go to the edge of my form.
| | 05:47 | Drag it in as well.
| | 05:49 | I am going to drag it into close to
the 6 inch mark, give a little bit of
| | 05:53 | space on the outside.
| | 05:54 | Now, I have changed the size
at least the width of my form.
| | 05:58 | So that might be a little
bit easier to work with.
| | 06:02 | I don't need all this space for the first
name, last name, street, etcetera. Okay.
| | 06:07 | What about the look of our form now?
| | 06:09 | The background, the colors, the
font, etcetera, that are used.
| | 06:13 | Well, for that we might want to
switch over to the Arrange tab.
| | 06:17 | We have got some AutoFormat options here.
| | 06:19 | I am going to click this little
dropdown and you may have remembered this from
| | 06:24 | creating a form using a wizard.
| | 06:25 | We had a lot of options and these
are them for the look of our form.
| | 06:29 | So I kind of like this one down here
as I hover over it. It says technique.
| | 06:33 | I am going to click on it, which is
going to change the look of my actual form.
| | 06:39 | There is a lot of other things that we
could do and we'll save some of them for
| | 06:43 | later on including Command buttons,
and labels and so on, but right now, I am
| | 06:48 | almost satisfied with this title
which is currently selected by the way.
| | 06:52 | I might want to change the font and
I can do that from the Font section.
| | 06:56 | So right now you can see
the font that's being used.
| | 06:59 | I can click the dropdown and choose
something that might look a little bit nicer.
| | 07:05 | I like this one right here, the
alignments on the left. That's fine.
| | 07:10 | The size could be a little bit bigger.
| | 07:12 | I'm going to go up to 20 and that looks great.
| | 07:16 | Now I am going to keep the colors
because color combinations are fine, based on
| | 07:21 | style that I selected a moment ago.
| | 07:23 | I'm going to click outside that area to
deselect and see what that looks like.
| | 07:27 | Now when I switch to Form View, I am
going to have a totally different look
| | 07:30 | then when I started.
| | 07:32 | So here's our new form.
| | 07:33 | You can see that looks pretty good.
| | 07:35 | Fields aren't so wide, a little bit
easier to look at and manage, so I scroll
| | 07:40 | down, I still got the Orders table in there.
| | 07:42 | That's great, each of them
with their own navigation buttons.
| | 07:46 | Right, so those are some basic
changes that we can make to a Form's design.
| | 07:51 | We are going to go deeper into this as
we go through the various lessons in this
| | 07:54 | chapter including some of those
command buttons, restricting the type of
| | 07:59 | information that can go into fields and so on.
| | 08:01 | But you should have a good handle now
on how to make some basic changes or
| | 08:05 | modify your Form's design.
| | Collapse this transcript |
| Creating subforms| 00:00 | As we continue our work with forms in
Microsoft Access, we are going to look at
| | 00:04 | another feature to make it even more
convenient for you to add records to
| | 00:08 | tables using forms.
| | 00:10 | Now a few lessons when we created a
Customers form, the one you see here on the
| | 00:15 | screen, before we modified it,
something happen for us automatically, when we
| | 00:19 | chose one of the Prefab
options for creating form.
| | 00:22 | The Orders table appeared at the
bottom of this form because we use the
| | 00:26 | Customers tables to create this form
and the Orders was a related table.
| | 00:31 | So that's very convenient for us as we
scroll through the various customers in
| | 00:34 | this form to see all of
their orders in a table below.
| | 00:38 | Well we already know that forms are
kind of like windows into the various data
| | 00:43 | in the various tables in your database.
| | 00:45 | So why not put a form at the bottom of our form.
| | 00:47 | In other words nest it right inside
the existing form. We can do that.
| | 00:51 | It's called the subform.
| | 00:53 | So what we are going to do with an
existing form is nest another form inside of
| | 00:58 | it to change its appearance
to make it easier to work with.
| | 01:01 | All right the first thing that we need
to do though is to open up Acme2007d from
| | 01:07 | the Lesson07 folder of your Exercise Files.
| | 01:09 | As a matter if you are following along,
go ahead and open up this one if you
| | 01:12 | have the Exercise Files.
| | 01:13 | So we are all starting on the same page.
| | 01:16 | The next thing we are going to do is
create a new form for the Orders Table,
| | 01:20 | right now there isn't one.
| | 01:21 | So when we click on the Orders Table,
and we go up to the Create tab, we are
| | 01:26 | going to click on Multiple Items.
| | 01:28 | This is a form that kind
of looks like a datasheet.
| | 01:31 | So we are going to go choose
Multiple Items, and you can see that was
| | 01:34 | pretty quick and easy.
| | 01:36 | There is our Orders table.
| | 01:37 | You can see we have got
three orders in there already.
| | 01:40 | And we are looking at the
form version of this table.
| | 01:43 | So it looks very familiar.
| | 01:44 | It's kind of like a datasheet because
the records are in rows from left to right.
| | 01:49 | All right we need to save this.
| | 01:51 | We are going to save it, keeping the
default name, which is Orders. We click OK.
| | 01:56 | You can see it gets added underneath the
Orders table, here on the Navigation Pane.
| | 02:00 | All right so we are going to switch
back to the Customers form now, and we are
| | 02:05 | going into Design View.
| | 02:07 | So we go up to the View
button, come down to Design View.
| | 02:10 | We have been here before and we are going to
scroll down where the Orders table appears.
| | 02:16 | I am going to click on it
and hit Delete on the keyboard.
| | 02:20 | It's gone just like that.
| | 02:22 | Now all we need to do is get the Orders
form in here instead and we do that by
| | 02:26 | coming over to the Navigation Pane,
clicking and dragging the Orders form right
| | 02:31 | down here into the existing form.
| | 02:34 | Now obviously where we drop it is important.
| | 02:37 | So I am going to drag it
over and up to the left like so.
| | 02:41 | We are even going to squeeze it in
here on the left and because of where I
| | 02:45 | dropped it you can see that the
form actually grew to accommodate it.
| | 02:49 | I can drag that back in right about there.
| | 02:52 | That looks good and now I am going to
have the Orders form instead of the table
| | 02:56 | showing up at the bottom.
| | 02:57 | So let's save this form called
Customers and let's change our view now to the
| | 03:03 | Form View, and you can see what happens,
this looks a lot nicer, down below.
| | 03:07 | I have actually got the Orders form showing up.
| | 03:11 | You can see I can move through those
orders using these Navigation buttons.
| | 03:16 | I move through the various customers using
the Navigation buttons down at the bottom.
| | 03:22 | Now the neat thing is not only can I
view this data, but I can actually add new
| | 03:27 | orders right here in the
Orders form for example.
| | 03:30 | If I want to add new
customers, I can add new customers.
| | 03:33 | And I can do it all from one screen.
| | 03:35 | This makes it very, very convenient for
me as I am working with both customers
| | 03:39 | and orders at the same time.
| | 03:40 | All right, now there is another way for
you to nest a form inside another form
| | 03:45 | or another words create a subform
and that's using the Form Wizard.
| | 03:50 | So that's what we are going to do next.
| | 03:52 | I am going to go up to the Create tab.
| | 03:54 | We are going to go to the Form Wizard.
| | 03:56 | Now before we do that let's
create another Customers form.
| | 03:59 | We are going to go click on Customers
Table right here in the Navigation Pane.
| | 04:04 | I am going to click on More Forms.
| | 04:05 | I am going to choose Form Wizard.
| | 04:07 | You can see that the table called
Customers is selected by default.
| | 04:12 | Well if we wanted all of those fields
except for the id, we can move that one back.
| | 04:19 | We can also add another
form, watch this. Click Next.
| | 04:22 | Columnar is the option that we want.
| | 04:25 | But when I go back and choose my Orders table.
| | 04:29 | You can see all of those fields become
available, and I can add those as well.
| | 04:34 | When I click Next, look what happens.
| | 04:37 | How do you want to view your data?
| | 04:38 | Well I want to view it By Customers,
which means that the Orders table or in
| | 04:43 | this case Orders form would be the subform.
| | 04:45 | Form with subform is selected down below.
| | 04:49 | When I click Next, I am back to my
two options, which are changed now,
| | 04:53 | Tabular or Datasheet.
| | 04:55 | I am going to Tabular.
| | 04:57 | Click Next, now I get to choose a style.
| | 05:01 | I am going to go leave it
at Technique. Click Next.
| | 05:04 | We can see I am going to have
Customers 1 and the Orders Subform.
| | 05:10 | I am going to leave those titles for
now I know I can go back and modify
| | 05:13 | the design at any time.
| | 05:14 | When I click Finish, I am
going to see the end result.
| | 05:18 | So there it is very similar to what we
had by modifying our own form design.
| | 05:22 | So there is Customers, down below
are the orders for that customer.
| | 05:28 | So when I close this, it shows up over
here as Orders Subform and Customers 1.
| | 05:35 | If I don't want those, I kind of like
my own design here, I can right-click in
| | 05:39 | this case Customers 1 and choose Delete.
| | 05:43 | I will need to confirm by clicking Yes.
| | 05:46 | Remember deleting the form
does not actually delete any data.
| | 05:50 | The data is still in the
table that it's related to.
| | 05:53 | The Orders Subform can also be deleted
with a right-click and a confirmation Yes.
| | 06:00 | So a couple of different
ways to create subforms.
| | 06:02 | You can do it yourself or via the
wizard either way, what you have done is you
| | 06:07 | have created a convenient way for you to look
at the data in more than one table at one time.
| | 06:13 | You can modify that data and even
add new data all from one screen.
| | Collapse this transcript |
| Adding command buttons to a form| 00:00 | Here's where we get to have a little bit
of fun with our forms in Microsoft Access.
| | 00:04 | We're going to add a Command button to
our form, and this is just going to make
| | 00:09 | life even more convenient for the user
who has to use this from to either view,
| | 00:14 | edit, or input data into
a table though this form.
| | 00:18 | So here's a typical scenario, maybe on
occasion as we go through the various
| | 00:23 | customers in our Customers form here,
we want to print out the data that we see
| | 00:27 | on our screen, in other words
print the form the way see it.
| | 00:30 | Well, we can add a button that it
makes it very convenient for that person to
| | 00:34 | just print the current form.
| | 00:35 | Now, how do we do that?
| | 00:37 | Well, we need to go into Design View.
| | 00:39 | First thing you'll notice up here on
the Title Bar is that I'm using a database
| | 00:42 | called Acme2007e, I got it from the
Lesson 7 folder of the Exercise_Files.
| | 00:47 | If you are jumping to this lesson,
this is the one you'll want to open up.
| | 00:51 | If you're following along from previous
lesson, you're okay with what you've got.
| | 00:55 | So once you are in you want to double-
click the Customers form over here, and
| | 01:01 | then we want to go up to the
View button, and select Design view.
| | 01:06 | Okay, so the very first thing I need to
do is create some room on the right if I
| | 01:09 | want to put my button over here.
| | 01:10 | So I'm going to go to the right-hand
side of the form and on the background here
| | 01:14 | I'm going to drag it out to
about the 7-inch mark right there.
| | 01:17 | Now I've got space for
buttons if I want to put them in.
| | 01:20 | To add a button, well we can go up to
the Control section here and you'll notice
| | 01:24 | that I've got a number of options.
| | 01:27 | I've got Text Box, and
Labels, and then there it is.
| | 01:30 | Here's where I go to add a Form Control button.
| | 01:33 | I've got other Form
Controls in here like Combo Boxes.
| | 01:37 | I've got List Boxes.
| | 01:39 | You even see Subform/Subreport.
| | 01:41 | All kinds of cool things
that we'll talk about later on.
| | 01:44 | Right now, we're going to focus on
adding a button, and I want you to
| | 01:47 | know what's over here.
| | 01:48 | Something very important in the Control
section is that these two buttons are selected.
| | 01:53 | So the very first one is Select, when
I move around here you can see that my
| | 01:56 | mouse pointer is a Select icon so I can
go in here and start selecting things.
| | 02:02 | The other thing that's on is Control Wizards.
| | 02:06 | That means when I come over here and
click this button I'm going to launch some
| | 02:10 | kind of wizard, same thing for
any of these other controls as well.
| | 02:14 | So I'm going to click on the Button
and all I have to do now is draw my
| | 02:20 | button where I want it.
| | 02:22 | So watch what happens when I come over here
and I just click-and-drag to draw a button.
| | 02:26 | The Command Button Wizard shows up by
default and that's because this is enabled
| | 02:32 | over here in the Control section of my ribbon.
| | 02:34 | All right, so what is this button going to do?
| | 02:37 | You can see that there are number of
Categories down in the left and then
| | 02:40 | Actions for the selected category.
| | 02:42 | Well, right now Record
Navigation is the selected Category.
| | 02:45 | That means I can create a Find Button,
to Find Next, Find a Record, I can
| | 02:50 | create Go To buttons.
| | 02:52 | Any of these can be used
on this button as a command.
| | 02:56 | I also have Record Operations.
| | 02:58 | So if I wanted to create a button for
adding New Records, I could do that.
| | 03:02 | How about Deleting
Records or Duplicating Records?
| | 03:05 | There's one to Print a Record.
| | 03:08 | Save and Undo are also Record Operations.
| | 03:11 | Then I've got Form Operations
under Categories. Look at this.
| | 03:14 | Apply a Form Filter, Close
or Open a Form, Print a Form.
| | 03:18 | I have got Print a form and I've also got
Print Current Form, two different things.
| | 03:24 | And Refresh Form Data.
| | 03:25 | Report Operations, so if I wanted to Mail
Reports, or Open Reports, Preview, etcetera.
| | 03:32 | Application is the next category.
| | 03:35 | I can create a Quit button
here that quits the whole thing.
| | 03:38 | And then Miscellaneous has
some Macro stuff and Table stuff.
| | 03:41 | So we want to go back to back to Form
Operations because that's where we saw
| | 03:44 | Print Current Form, we'll click Next.
| | 03:47 | Now our options are, do we want Text on the
button or a Picture of a Printer on the button?
| | 03:52 | Well, if I click the Browse button with
Picture selected, I can go browsing for
| | 03:58 | Bitmaps that I want to use,
I'm going to click Cancel.
| | 04:01 | I can also Show All Pictures, right now
it's Printer that is selected that's why
| | 04:05 | we're seeing a sample over here.
| | 04:07 | Show All Pictures shows me things like
Properties, Preview, and you see the icon
| | 04:12 | over here in the Sample area.
| | 04:15 | But really I shouldn't be showing them all.
| | 04:18 | It's really the Printer one that I
want because this command is going to
| | 04:21 | print my actual form.
| | 04:23 | When I click Next, I get to name my button.
| | 04:28 | So right now it's just
showing up for me as Command21.
| | 04:31 | You may have a different number
showing up there, depends on if you've done
| | 04:34 | any of these before.
| | 04:35 | It really doesn't matter, once there
we're going to put in our own information
| | 04:38 | so that when we'll go back into Design
View we know what this button is doing.
| | 04:42 | It's Printing Current Form, good.
| | 04:47 | When I click Finish, there is my icon.
| | 04:50 | I can resize this now that
the picture has been selected.
| | 04:55 | That's a good size right there.
| | 04:56 | And to see if this works I'm
going to back to my Form View.
| | 05:01 | There is my button as I scroll through
the various customers and I decide this
| | 05:06 | is the one that I want to print,
I can come up to my Print button.
| | 05:09 | It says Print Form.
| | 05:11 | When I give it a click the Print
dialog box shows up, clicking OK would
| | 05:14 | send this to my printer.
| | 05:16 | So I'm going to click Cancel.
| | 05:18 | I will not actually print it this time.
| | 05:20 | But it looks like we just created
some convenience for our users by
| | 05:24 | offering them a Command button in
this case that will print the current
| | 05:27 | record, or current form.
| | 05:29 | So you can see there's a number of
Commands and different Categories that we add.
| | 05:34 | We add Save buttons, and Close buttons.
| | 05:36 | You can rearrange using your form
design exactly where these buttons go in
| | 05:40 | accordance with the various
fields in your form and so on.
| | 05:44 | Design is totally up to you and now
you can also create added convenience for
| | 05:48 | the users who have to use these forms to
input, or modify data by adding Command
| | 05:53 | buttons wherever you like on the form.
| | Collapse this transcript |
| Sorting and filtering with forms| 00:00 | It was quite a few lessons ago when we
first explored some of the sorting and
| | 00:04 | filtering options in Microsoft Access 2007.
| | 00:07 | It was while we were working with tables.
| | 00:09 | Well, now that we're working in Forms,
the same sorting and filtering options
| | 00:13 | available in Access apply here.
| | 00:15 | So, that's what we're going to do.
| | 00:17 | First thing you need to do though is
open up Acme2007f from the Lesson7 folder
| | 00:22 | of your Exercise Files.
| | 00:23 | This is an updated database with some
additional records that will help us as we
| | 00:27 | go through some sorting
and filtering options now.
| | 00:30 | I've double-clicked, the Customers
form to open it up, and you can see by the
| | 00:34 | very bottom of my form
here, I'm at record 1 of 6.
| | 00:37 | This is the first record
that went in to my database.
| | 00:41 | Now, the order that the records
appear are simply chronological.
| | 00:45 | As they get entered, that's
the order that they appear.
| | 00:48 | Now if we want to change that order up,
you'll notice that up here on the ribbon
| | 00:51 | we've got a Sort and Filter section
just like we did when we're working with
| | 00:55 | tables and the same thing
applies here as we work with forms.
| | 00:58 | So if I want to sort for example,
by State, I could come in here to the
| | 01:01 | State field and I'm going to either Ascending
or Descending, I'm going to choose Ascending.
| | 01:07 | All right, so here we are at Record 1,
as I move through, you can see the
| | 01:12 | next one is Oregon, OR.
| | 01:15 | As we move through to the next one
there's a P, another P, another PA and we
| | 01:22 | end up with Wisconsin.
| | 01:24 | So, we've sorted alphabetically on the
State because we clicked in the field
| | 01:27 | first and then applied the Sort button.
| | 01:29 | Now, if we were to click the Descending
order, you can see now that Record 1 is
| | 01:35 | actually this one Claire Lucille form Wisconsin.
| | 01:37 | As I move through the different
records, they are now sorted in descending
| | 01:42 | order by the State.
| | 01:44 | So that can be handy.
| | 01:45 | Now even handier might be ability to
focus in on a specific group of record
| | 01:50 | and that's filtering.
| | 01:51 | And before we start filtering, let's
look at this last button down here, Clear
| | 01:56 | All Sorts, and return to our original
state, which is a chronological order, and
| | 02:00 | just click this button at the very bottom.
| | 02:03 | Now let's say we want to focus in on
just those records or just those customers
| | 02:07 | who live in the State of Pennsylvania.
| | 02:10 | Well again, I would go to the State
field and then come up to my Filter button.
| | 02:15 | You'll notice right away because
I've clicked in the State field, all of
| | 02:18 | my States appear here.
| | 02:20 | So, any customer who has information
in the State field is either going to be
| | 02:24 | California, Oregon, Pennsylvania or Wisconsin.
| | 02:27 | So, I choose the States that I want to view.
| | 02:31 | Now, the Select All checkbox,
by it clicking it deselects all.
| | 02:35 | So I'm going to deselect all and just select PA.
| | 02:39 | You can see down at the bottom, I'm at
Record 1 of only 3 now, so the number of
| | 02:43 | records just got cut in half.
| | 02:45 | And as I move through those records,
you'll see that each one them belongs to
| | 02:49 | the State of Pennsylvania.
| | 02:50 | All right, you'll also notice up here
in the Sort and Filter section that the
| | 02:56 | Toggle Filter button has now been highlighted.
| | 02:59 | That means we can turn off the Filter by
clicking it, we're back to 6 records now.
| | 03:05 | And if we want to quickly go back,
we click the Toggle Filter button.
| | 03:08 | You can see that Filtered now appears
down here on my Status Bar, and I'm back
| | 03:12 | to those three records for
the State of Pennsylvania.
| | 03:15 | So I'm going to turn that
off and look at some options.
| | 03:19 | Again, I'm going to click in the State
field and you'll notice that there is a
| | 03:22 | Selection button and an Advanced button.
| | 03:24 | I'm going to click on Selection.
| | 03:26 | Here's where we get to choose Equals,
Does Not Equal, Contains, or Does Not
| | 03:31 | Contain, in this case CA because I
clicked in the State field in my particular
| | 03:36 | record where the State equals CA.
| | 03:38 | So, if I want to see everyone who's
not in the State of California, I would
| | 03:42 | choose Does Not Equal CA.
| | 03:43 | So, you can see that's 5
of my 6 records down below.
| | 03:48 | Again, the Toggle Filter button is
highlighted so I can turn off that filter and
| | 03:52 | go back to it with the same click, at any time.
| | 03:54 | All right, let's go into the State field again.
| | 03:58 | We'll Go to our Selection and say Equals CA.
| | 04:02 | As soon as I see that, you can see there's
only one customer in the State of California.
| | 04:07 | And we'll turn that off.
| | 04:08 | Now if I move to another record where I've
got the State equaling PA and click in there.
| | 04:14 | Now, when I go to my Selection button, you can
see its Equals PA, Does Not Equal PA etcetera.
| | 04:21 | So, if I want to see everyone who's
not in the State of Pennsylvania, I
| | 04:24 | can click here, three of them are not,
there's one in California, Oregon and Wisconsin.
| | 04:29 | I'll Toggle that off, and we're
back to our original set of records.
| | 04:35 | Now, let's go to the Advanced.
| | 04:36 | Now, I'm going to click on Advanced right now.
| | 04:38 | You can see I can Clear All Fliters, I
can Filter By Form, and this is interesting.
| | 04:42 | I can Apply a Filter/Sort that I've
selected, and then I've also got an
| | 04:46 | Advanced option down here.
| | 04:48 | I'm going to go up to Filter By Form.
| | 04:51 | Now it kind of looks funny here
because you can see the last thing I did was
| | 04:56 | Not Equal to PA, and that shows up here.
| | 04:58 | I've got a drop-down now in the State
field, where I can choose different states.
| | 05:04 | So there it is.
| | 05:04 | If I toggle the filter, you can see
there's only one in the State of Wisconsin,
| | 05:10 | and that's another way to do it.
| | 05:11 | I'm going to turn that off.
| | 05:14 | Let's go back now to the
Advanced button Filter By Form.
| | 05:18 | I'm going to click on this drop-down here.
| | 05:20 | I am going to choose PA.
| | 05:22 | But then I'm going to take it a step further.
| | 05:24 | I want the City of Manotick, so I can
actually type in an M as in Manotick,
| | 05:30 | automatically that shows up.
| | 05:32 | I could have went to the drop-down to
see a list of all the different cities
| | 05:35 | that my existing customer list live in.
| | 05:38 | So I'm going to use Manotick.
| | 05:38 | I'm going to toggle that.
| | 05:41 | You could see there's two in
Manotick, PA, and I can sort through.
| | 05:46 | So it just narrows down the fields, so
if need to work on a specific group of
| | 05:50 | records, I can quickly filter down to
that group of records and at anytime
| | 05:54 | return back to the full list.
| | 05:57 | So keep in mind the Toggle Filter button,
it will take you back to your previous
| | 06:00 | filter at anytime, and if you want to
change it up, you've the Filter option.
| | 06:05 | You've got the Selection button and of
course using Advanced, you can Filter By Form.
| | 06:09 | I'm going to turn that off, return
to my original list, and that covers
| | 06:14 | Sorting and Filtering.
| | Collapse this transcript |
| Switchboards vs. the Navigation pane| 00:01 | You may be familiar with
switchboards and a switchboard is really just a
| | 00:04 | form but with buttons or links on it that
enable the user to navigate around the database.
| | 00:10 | Here is an example of a simple one that
allows users to add customers, products,
| | 00:14 | and orders into the various tables.
| | 00:17 | You will notice there is no button
here for modifying the database design
| | 00:21 | or running reports.
| | 00:23 | As a designer, I have really good
control over what a user can or cannot do
| | 00:28 | through the switchboard.
| | 00:30 | Now the Switchboard in the past would
make special use of something called the
| | 00:33 | Database Window in previous versions of Access.
| | 00:36 | While the Database Window is gone in 2007,
it's replaced by the Navigation Pane.
| | 00:42 | We looked at the Navigation Pane in a
previous lesson, and you can see I have
| | 00:46 | got it over here on the left hand side.
| | 00:47 | It's just not opened right now.
| | 00:50 | If I click the Shutter bar at the top,
I can open and close my Navigation Pane.
| | 00:56 | Well, the Navigation Pane actually works
with this new user interface model that
| | 01:00 | was adopted by Access 2007.
| | 01:02 | It's called the Single Document
Interface Model, and all that does is it
| | 01:06 | places any open objects whether it's
forms or reports, queries, and so on,
| | 01:11 | into a single window and it will mark
each object with a tab right here across
| | 01:16 | the top of the screen.
| | 01:17 | So right now, the Switchboard is open.
| | 01:19 | If I go to my Orders Table and click
on it, on my Orders Form, you can see
| | 01:23 | there is a tab for that.
| | 01:24 | If I go to Customers, there is a tab for that.
| | 01:28 | So I can switch back and forth through
my various forms just by clicking their
| | 01:32 | tab, which is maybe a little bit
easier than using a Switchboard.
| | 01:36 | To close them up, I right-click
and choose Close.
| | 01:42 | So with the switchboard, we are
actually enforcing a little bit more control.
| | 01:45 | We can close up the Navigation Pane
and just move around our different forms
| | 01:50 | using these buttons and using Go Back.
| | 01:52 | Now the tab still show up
across the very top of the screen.
| | 01:56 | So you will have to decide if a
Switchboard is useful for you or if the
| | 02:00 | Navigation Pane will give
you everything you need.
| | 02:03 | So let's recreate this
Switchboard in another database.
| | 02:07 | I have been using this
SwitchboardSample database from the lesson_07 folder
| | 02:10 | of the exercise_files.
| | 02:12 | You've got access to it too but
we are going to open another one.
| | 02:15 | We will go up to the
Office button and click Open.
| | 02:19 | Next, you will need to navigate to your
exercise_files to lesson_07 folder, and
| | 02:24 | in there, you'll find Acme2007g.
| | 02:27 | Give that one a click and click Open.
| | 02:29 | We'll often see this security warning
because with Access, there is VBA macros
| | 02:35 | involved, and people use
VBA macros to write viruses.
| | 02:39 | So we need to enable that content by
clicking the Options button, clicking the
| | 02:44 | Enable this content radio button
and clicking OK before we move on.
| | 02:48 | All right, so in this particular
database, we have got tables for customers,
| | 02:54 | orders, and products, as well as
forms for entering data into those tables.
| | 02:59 | We have seen this before.
| | 03:00 | If we click Customers,
this should look familiar.
| | 03:02 | Notice down below, I have got
six customers in my database.
| | 03:06 | I made customer or record 1 of 6 right now.
| | 03:10 | That's going to be important as we
create our Switchboard in a moment.
| | 03:13 | I am just going to close this up.
| | 03:15 | I am going to right-click, choose
Close from the tab at the top, and now to
| | 03:20 | create a Switchboard, the easiest way
is to go up to your Database Tools up
| | 03:23 | here on the Ribbon.
| | 03:25 | Next, on the far right under Database
Tools, you will see something called the
| | 03:29 | Switchboard Manager.
| | 03:30 | We will give that a click.
| | 03:31 | We will see this message pop up, saying
that the Switchboard Manager wasn't able
| | 03:35 | to find a valid switchboard in the database.
| | 03:38 | Of course, now we haven't created one yet.
| | 03:40 | Well, would you like to create one?
| | 03:42 | And the answer is yes.
| | 03:44 | Now since we do that, the
Switchboard Manager dialog box shows up.
| | 03:48 | There is one default switchboard called
Main switchboard, and that's the first
| | 03:52 | open to be created and it now
shows up here on my Navigation Pane.
| | 03:57 | Well, if I go over here to Edit, my new
switchboard I can rename it, which I am going to do.
| | 04:03 | I am going to call it Main
Menu instead of switchboard.
| | 04:07 | Now I just need to add the items down
below that will show up on my switchboard.
| | 04:11 | So I'll click the New button and I
can enter Text, the Command, and the
| | 04:17 | Switchboard or Form in this
case that's going to be used.
| | 04:20 | The text is going to read like this,
Add New Customers, Command itself is not
| | 04:28 | going to go to the Switchboard.
| | 04:29 | It's actually going to open a Form but
I have got two modes, Edit which is the
| | 04:34 | default when we open up a form from
the Navigation Pane, but we have also got
| | 04:38 | Open Form in Add mode.
| | 04:40 | Now you can see this changes to
Switchboard, so the form that I want to open in
| | 04:44 | Add mode is the Customers form and I click OK.
| | 04:48 | So I have got my first item.
| | 04:50 | We just need two more.
| | 04:51 | So I will click New again.
| | 04:53 | This one will be for adding new products.
| | 04:56 | I am going to open a form in Add
mode and the form is the Products form.
| | 05:03 | One to go, so I will click New
one more time, Enter New Orders.
| | 05:09 | This is also going to open up a
Form and the form is called Orders.
| | 05:15 | There we go we have got them.
| | 05:17 | When we click Close, we are
taken back to the first page of the
| | 05:21 | Switchboard Manager.
| | 05:22 | This is now called Main Menu.
| | 05:24 | When we click Close, we have
created our first Switchboard.
| | 05:29 | Now it doesn't show up here yet but
it does show up on our Navigation Pane.
| | 05:32 | So when I click the Switchboard Form
not the Table, the Table is just going to
| | 05:37 | contain all of the
commands that we have selected.
| | 05:39 | The Form itself when I click on it
shows up in its default format, we didn't
| | 05:44 | have a lot of opportunity to alter the
format but this is the default that we
| | 05:49 | end up with its Main Menu
and there is our three buttons.
| | 05:52 | Let's see if it works.
| | 05:53 | I will go to Add New Customers, look at that.
| | 05:56 | I have got a blank record, Record 1
of 1 according to the bottom here.
| | 06:00 | So I am ready to add a new customer.
| | 06:03 | I don't see the existing
ones, but I can add new ones.
| | 06:06 | What's missing is Automation over
here to take me back to the Switchboard.
| | 06:11 | So for now, I am gust going to right-click
on Customers and choose Close to go
| | 06:16 | back to the switchboard.
| | 06:18 | So we have got a couple of tasks ahead of us.
| | 06:20 | We need to build some automation into
the Customers Form, and then we might want
| | 06:24 | to alter this format a little bit.
| | 06:25 | It doesn't look so hot, does it?
| | 06:27 | So let's start with our Switchboard here.
| | 06:29 | We can go to Design View like with
any other Form by clicking the View
| | 06:32 | button, choose Design View.
| | 06:34 | I am going to close up the Field List.
| | 06:37 | If yours is open, you can close it too.
| | 06:39 | We don't need it but we are going
to change some of the formatting.
| | 06:43 | If you recall from earlier lessons
when we worked on Forms, we can access
| | 06:48 | something called Auto Format by
clicking the Arrange tab up here and there is
| | 06:52 | the Auto Format button on the left.
| | 06:54 | So when I click that drop down, you can
see I have got a whole bunch of choices
| | 06:58 | as I hover over them.
| | 06:59 | You can see I get the name
of that particular style.
| | 07:02 | I am going to go down to this Windows
Vista one, click on it, and already you
| | 07:06 | can see there is a nice change, may not
be perfect but we'll only know once we
| | 07:11 | change back to our Form View.
| | 07:13 | So let's go back to the Home
tab and change back to Form View.
| | 07:18 | It's better but not perfect.
| | 07:19 | I would like to move these down a
little bit and I would like to fix up the
| | 07:22 | shadowing that's going on.
| | 07:24 | So back we go to the Design View and I'm
going to click in here and move my text
| | 07:32 | up and over a little bit, the shadow
text in behind, I am going to click on it
| | 07:37 | and I am going to change its color.
| | 07:39 | I am going to change the
Font Color to dark blue.
| | 07:41 | I am going to move it up slightly
under and over from my original title.
| | 07:47 | Notice here in Design View, we see
the title of the actual database we are
| | 07:51 | using, but the title we gave this
Switchboard shows up when we go back to Form View.
| | 07:57 | The other thing I want to do before we
switch back is to create a little more
| | 08:00 | space in the Form Header.
| | 08:01 | So I am going to come up here when I see the
double arrow, I am just going to drag downwards.
| | 08:05 | That should do it.
| | 08:06 | When I switch to Form View now, look at that.
| | 08:09 | That looks much better.
| | 08:10 | So let's save our changes
by clicking the Save button.
| | 08:14 | All right, so we do have some automation
that needs to go into our Customers Form.
| | 08:18 | So if I click Add New Customers, it
takes me to the Customers Form in Form View.
| | 08:23 | I am going to change to Design View now,
and I have got some room over here for
| | 08:30 | a Go Back button, a Print button, whatever.
| | 08:33 | So let's just create one first, and
then I will show you shortcut in a second.
| | 08:37 | I'm going to click this button, come
down here, click-and-drag right away the
| | 08:41 | Command Button Wizard dialog shows up
because this is selected over here under
| | 08:46 | the Control section.
| | 08:47 | So my wizard is enabled.
| | 08:49 | This is going to do a form operation,
so I am going to click over here in Form
| | 08:53 | Operations and I wanted to close the form.
| | 08:55 | So I'll click Close Form and then Next.
| | 08:58 | It's going to give me the default
picture, which is the Exit Doorway symbol.
| | 09:02 | Let me click Next, and I am going to
name this button just for my own purposes
| | 09:07 | in Design View when I look at the objects,
I will know this is the Close Button,
| | 09:13 | and I will click Finish.
| | 09:14 | All right let's try it out.
| | 09:16 | We'll go back to Form View.
| | 09:18 | Before we do, we should save our changes.
| | 09:20 | In Form View, we now have a button we
didn't add a text label underneath, but if
| | 09:26 | we click it, it works.
| | 09:28 | All right if I go to Add New Products,
I want to show you that I have already
| | 09:32 | added these buttons.
| | 09:33 | Here is the Go Back button.
| | 09:34 | I also put a little text box
underneath that says Go Back.
| | 09:37 | I did the same for Print.
| | 09:39 | It would be nice to just borrow these
from this particular form and add them
| | 09:43 | to our Customers Form.
| | 09:44 | So I am going to switch to
Design View here in the Products Form.
| | 09:49 | I'm going to highlight these, just by
clicking and dragging over them, Ctrl+C as
| | 09:55 | in copy on the keyboard.
| | 09:57 | We'll copy what's selected.
| | 09:58 | So now I can right-click on
Products and choose Close.
| | 10:03 | I can go to my Customers Form
either by Add New Customers or clicking
| | 10:07 | Customers over here.
| | 10:09 | Switch to Design View.
| | 10:12 | Before I paste in the new stuff, let's
get rid of this one that we just added.
| | 10:16 | I'll click on it once, hit Delete,
Ctrl+V as in Victor on the keyboard.
| | 10:21 | We'll paste what we copied a moment ago.
| | 10:24 | I am going to click-and-drag those
over here, and now it's going to look
| | 10:27 | consistent with my other form.
| | 10:28 | I am going to save those changes.
| | 10:31 | I am going to close this Customers Form by
right-clicking on the tab, choose Close.
| | 10:36 | I am going to minimize this
Navigation Pane and let's see.
| | 10:41 | If our Add New Customers button works.
| | 10:44 | Yeah, it takes us to a new
record in our Customers Form.
| | 10:47 | There is my button.
| | 10:48 | Clicking Go Back closes the form
and brings me back to my switchboard.
| | 10:53 | So as you can see, it's still
possible to create switchboards in Microsoft
| | 10:58 | Access 2007 but it may not be as
important to do so, now that you have got the
| | 11:05 | Navigation Pane and a quick way to
navigate through the various objects in your
| | 11:09 | database either through the tabs that
appear when an object is opened, or from
| | 11:13 | the Navigation Pane
itself down the left hand side.
| | 11:17 | The option is yours.
| | Collapse this transcript |
|
|
8. Working with ReportsUsing the Report wizard| 00:00 | Well, I guess it's time to ask
the big question and that is, why?
| | 00:04 | Why do we create databases?
| | 00:06 | Why do we input tons of
data into tables in a database?
| | 00:10 | Well, usually it's to stay organized, a
database is an organized collection of
| | 00:15 | information and by entering data
into our database we can stay organized.
| | 00:19 | But usually what happens down the
road is we want to extract some of that
| | 00:23 | information and display it in a
meaningful format that's where reports come
| | 00:28 | in and there are number of different ways
to create reports in Microsoft Access 2007.
| | 00:31 | We are going to look at a few
different ways to do that in this chapter.
| | 00:36 | We are also going to look at ways to
modify the design and add some cool
| | 00:41 | features like calculations
and so on to our reports.
| | 00:45 | If you look up at the title bar at
the top, I have opened up a database
| | 00:48 | called AcmeReportA.
| | 00:50 | You will find that in the lesson_08 folder
of your exercise_files if you have got them.
| | 00:54 | Go ahead and open that one up and you
will notice on the left-hand side in the
| | 00:58 | Navigation Pane, I have got Customers, Orders
and Products, Tables and Forms for each of them.
| | 01:04 | Now I can base a report on a table or a
query, I currently don't have any query
| | 01:09 | showing up here, so keep that in mind
as we create our first report, which is
| | 01:14 | going to be based on a typical scenario
where we have customers and want to get
| | 01:18 | a nice list of our customers in
alphabetical order with their phone numbers.
| | 01:22 | Yes, we are going to create a phone list.
| | 01:24 | So the keyword there is create.
| | 01:26 | We go up to the Create tab on the Ribbon
and there is a Report section over here.
| | 01:31 | You will see there is
different ways to create a report.
| | 01:33 | Here we can do it from scratch and
this is just creating a basic report based
| | 01:38 | on a table or a query.
| | 01:39 | We can start from scratch
for real here with a blank one.
| | 01:42 | We can use the Report
Wizard to give us a head start.
| | 01:46 | That's what we are going to do in a second.
| | 01:47 | We can even create Labels and
we will do that later on as well.
| | 01:51 | The Report Design button is what we
are going to use to back into an existing
| | 01:55 | report and modify the design.
| | 01:58 | So let's start with the Report Wizard,
we will give it a click and the Report
| | 02:01 | Wizard dialog box starts up. Now the Customers:
| | 02:05 | Table is currently highlighted over
here in the Navigation Pane and that's why
| | 02:08 | it shows up here under Tables/Queries.
| | 02:11 | But if I needed to choose from a
different table I click the drop-down, choose
| | 02:15 | whatever table or query that I might
have in this database to base my report on.
| | 02:20 | I am going to select Customers.
| | 02:22 | That displays the customer fields down below.
| | 02:26 | So let's think about this.
| | 02:26 | We want an alphabetical phone list.
| | 02:28 | It's probably going to be by Last Name, so
let's start with the Last Name field. Click on it.
| | 02:33 | The double arrow would add all of our
fields, we don't want all of our fields
| | 02:36 | just a few so we will use
the single arrow button.
| | 02:39 | There is the Last Name, let's add the
First Name and the phone number, we click
| | 02:46 | Phone and the single arrow moves it over.
| | 02:49 | So we have selected our fields, now
let's move on to the next step in the Wizard.
| | 02:53 | Clicking Next takes us to the next question
and that is, do we want to do any grouping?
| | 02:58 | In other words, if we've got a number
of customers with the same last name, do
| | 03:02 | we want them all grouped together and
then maybe sorted by their first name?
| | 03:06 | Well we can do that, let's click on
Last Name, if it's not selected, and click
| | 03:09 | the single arrow to move it over and
you can see what happens here in my
| | 03:12 | Display Pane, I've got Last Name here
and then the first name and the phone
| | 03:16 | number which show up underneath.
| | 03:18 | All right, if I wanted to, I could group
on any of the fields that show up here.
| | 03:22 | Grouping Options is also available
down at the bottom, when I click on that
| | 03:27 | you can see I am asked for what
grouping intervals do I want for the
| | 03:30 | group-level fields.
| | 03:32 | Right now Last Name is selected and
the Grouping intervals are Normal.
| | 03:35 | If I wanted to do it by the first 2
Initial Letters I can do that and click OK.
| | 03:43 | So at least I am going to see the last
name here next to the first name and it's
| | 03:46 | going to be grouped by the first two
letters in the last name. Let's click Next.
| | 03:54 | Now we get to choose what sort order we
are going to use for the detail record.
| | 03:58 | So we already know that we are
grouping by last name, when I click this
| | 04:02 | drop-down, the first two initials are
going to be used for the grouping from the
| | 04:06 | last name, inside of that
we want to sort by Last Name.
| | 04:09 | We will go ascending order.
| | 04:11 | And then for all of those with the same last
name, maybe we should sort by the First Name.
| | 04:16 | So we will do that, and that's all
we need for this particular screen.
| | 04:20 | Let's move on to the next one.
| | 04:22 | Clicking Next takes us to a question
where we are asked, How would we like
| | 04:26 | to layout our report?
| | 04:28 | And right now Stepped is
selected you can see it over here.
| | 04:31 | As I click on these options for Layout,
I see a quick display on the left of
| | 04:36 | what it might look like.
| | 04:37 | I can go Portrait or Landscape, I am
going to stay with Portrait and I am going
| | 04:43 | to stay with Stepped.
| | 04:44 | Notice down below this is checked as
well, the fields will automatically be
| | 04:48 | adjusted, so that all of the contents of the
field and those fields will fit on the page.
| | 04:54 | I will click Next and now
I get to choose a style.
| | 04:58 | For me, Flow is selected right now.
| | 05:01 | You may have something different selected.
| | 05:02 | It depends if you have created any
reports in the past, but clicking any of
| | 05:07 | these will give you a quick
preview of what that might look like.
| | 05:10 | I am going to go with Metro
and I am going to click Next.
| | 05:13 | All right, what do we want to call this report?
| | 05:17 | Customers is the default because it's
based on the customers table, I am going
| | 05:20 | to leave it at Customers, but I am
going to add Customers Phone List to the end
| | 05:28 | and you can see now when I hit Finish, I
am going to be previewing the report if
| | 05:32 | I want to go straight to the Reports
Design, I could select this radio button.
| | 05:36 | But I want to see what it looks like, so I am
going to leave that selected and click Finish.
| | 05:41 | So there is my phone list.
| | 05:43 | You can see the first two
initials from the last name.
| | 05:45 | Here is a bunch of last names that are
the same, they are sorted in ascending
| | 05:50 | order by first name and
there is the phone numbers.
| | 05:53 | So a nice clean list of my customers and
their phone numbers. So that was easy.
| | 06:00 | How do we go back now and
modify the design of a report?
| | 06:04 | That's what we are going to
look at in the next lesson.
| | Collapse this transcript |
| Modifying reports in Design view| 00:00 | In the previous lesson, we created our
very first Report in Microsoft Access
| | 00:05 | 2007 using the Report Wizard.
| | 00:07 | So a number of screens popped up,
we made our selections and based on
| | 00:10 | those selections we represented
with the following Report, which is our
| | 00:14 | Customers Phone List.
| | 00:15 | Now the Customers Phone List is
automatically displayed in Print Preview because
| | 00:21 | of the very last option we selected in
the Wizard, and that was to show us the
| | 00:25 | very first ten records of
our Report in a preview.
| | 00:29 | This way we can see what it looks
like, we can decide if all of the
| | 00:32 | selections we made were the right selections
and if not we can to back and modify the design.
| | 00:38 | That's what we are going to do in this lesson.
| | 00:40 | So I know I am in a Print Preview because I
see the Close Print Preview button up here.
| | 00:45 | Now, if you are jumping to this
lesson you can go ahead into your Lesson 8
| | 00:49 | folder of your Exercise_
Files and open up AcmeReportB.
| | 00:52 | You will find it there.
| | 00:54 | You will need to click on the
Customers Phone list, and when you do that you
| | 00:58 | will actually be brought into the Design View.
| | 01:01 | So if I double click this, for example,
and close my Print Preview and you come
| | 01:07 | into your Design View like this.
| | 01:08 | If you want to get to the Print
Preview at any time, you can come up here and
| | 01:12 | click this little icon, which will
preview the first ten records, give that a
| | 01:16 | click and you will be all caught up.
| | 01:17 | All right, I want to just show you from
Print Preview that there are a number of
| | 01:21 | things you can do to modify
your Report right from here.
| | 01:25 | You don't have to go
into Design View right away.
| | 01:27 | For example, up here under Page Layout,
we have got options for changing the
| | 01:31 | size of our paper, our Page Size,
the Orientation, right now Portrait is
| | 01:37 | selected but I can choose Landscape.
| | 01:38 | I can change Margins, Columns, Print Data Only.
| | 01:42 | Now I have got a Page Setup button that
will allows me to get into the details
| | 01:45 | of all of these things.
| | 01:47 | Right now though if I move around my
Report with my mouse pointer, you can see
| | 01:50 | that it's actually a magnifying glass.
| | 01:53 | It has a minus sign in it right now so that
means if I click once I am going to zoom out.
| | 01:57 | If I want to zoom in to a particular
area I can move to that area and click and
| | 02:02 | I am zoomed into that portion of my Report.
| | 02:06 | Zooming out, zooming in.
| | 02:10 | I am going to zoom right
into the middle section here.
| | 02:12 | All right, so I may want to change
a few things, if I go to Landscape.
| | 02:16 | From this mode I really don't see a change.
| | 02:18 | So I am going to zoom out to see what
that looks like, lots of empty space over
| | 02:22 | here, I will flip back to Portrait.
| | 02:24 | How about the Margins?
| | 02:25 | From the drop-down I have got three
choices, Normal, Wide, and Narrow.
| | 02:29 | If I click on Narrow, you can see
that it takes it right up to the top.
| | 02:33 | I don't need to do that.
| | 02:34 | I am going to back to Wide
and see what that looks like.
| | 02:38 | No, little squished in.
| | 02:40 | I am going to go back to Normal.
| | 02:41 | Now if I wanted to put in my actual own
Margin figures or values then I could go
| | 02:47 | into the Page Setup right over here.
| | 02:49 | When I click Page Setup, I am going to
see tabs across the top including Print
| | 02:53 | Options, there is a Page tab, and the
Margins that are being used currently show
| | 02:58 | up here, those values.
| | 02:59 | I can change those if I wanted to.
| | 03:01 | Under the Page tab, I have got the
Orientation and the Paper Size, also
| | 03:05 | the Default Printer.
| | 03:07 | Under the Columns tab I can choose the
Number of Columns I want to do, Column Size.
| | 03:12 | I am going to hit Cancel to leave it as is.
| | 03:17 | Now when I am viewing, obviously I know
now that I can zoom in and out but what
| | 03:21 | if I want to take it to a specific zoom level.
| | 03:23 | There is a Zoom section
when I click the drop-down.
| | 03:26 | I want to go to 50%.
| | 03:27 | You can see what that looks like.
| | 03:29 | Let's go back to 100%.
| | 03:33 | And if I want to see the whole thing on one
page, Fit to Window, there we go, perfect.
| | 03:39 | If I have got tons and tons of records
that show up on many, many pages in this
| | 03:43 | Report, I can switch the number of
pages I am looking at, One Page, Two Pages,
| | 03:48 | and you can see I don't have enough
records to flow it on to the second page.
| | 03:52 | If wanted to see more pages than two on a
single screen I could do that 4, 8, and 12.
| | 03:57 | But I am going to go back to One Page.
| | 04:00 | Now, when I am done viewing this in
Print Preview, I can click the Close Print
| | 04:04 | Preview button and go back to the
Design mode where I can actually make changes
| | 04:10 | to the design of this particular Report.
| | 04:13 | So there are several sections to my Report.
| | 04:15 | There is a Report Header.
| | 04:16 | This information will appear at the
top of the first page only in my Report.
| | 04:21 | The Page Header, this
information, Last Name by 2 Initials.
| | 04:24 | These little headings will
show up at the top of every page.
| | 04:28 | Then I have got the Last Name Header,
you can see that, saying that I was
| | 04:33 | going to be searching for the first two
characters in the last name and grouping that way.
| | 04:38 | And that was based on the selection we
made during the Report Wizard function.
| | 04:43 | And then down below is the actual
Details of the Report here is where I see the
| | 04:46 | actual Last Name, First Name
and Phone Number right in here.
| | 04:51 | So if I needed to add some fields,
I can go to my Field List here.
| | 04:55 | The Field List shows up whenever this
button is selected, Add Existing Fields.
| | 05:00 | If I click this button I close it up, if
I click this button it toggles back on.
| | 05:05 | So if I thought it might be good to
have the e-mails in there as well, while I
| | 05:09 | try to find a space for it and add the e-
mail by simply clicking and dragging it
| | 05:14 | from here on to my Report.
| | 05:17 | That's kind of stuff I would want
to drag into the Detail section.
| | 05:21 | I do have some things showing up in
the Page Footer by default, this =Now ()
| | 05:26 | code represents the current date.
| | 05:29 | If I scroll over to the right, I
can see some code for putting in the
| | 05:33 | actual page that I am on.
| | 05:36 | Page one of one, for example.
| | 05:38 | All right, other things I can do to the design.
| | 05:42 | You will notice I have got a Design tab
up here and I have also got Arrange, and
| | 05:46 | I have got Page Setup.
| | 05:48 | So there is my Page Setup options again
which I can alter right here from Design
| | 05:52 | View or I can go up to the
Arrange, choose a different format.
| | 05:55 | I kind of like this Windows Vista one
here, so I am going to give it a click, I
| | 06:00 | am going to see what looks like.
| | 06:03 | Remember, we can go up to the
Design tab and choose Print Preview.
| | 06:07 | That looks kind of cool.
| | 06:10 | I am going to zoom in, interesting.
| | 06:11 | It looks like anywhere where I have
got more than a couple of records or more
| | 06:17 | than one that I am going
to see alternating bands.
| | 06:21 | So it makes it easier to
read in this Report, very cool.
| | 06:26 | So making changes to an
existing Report, not a big deal.
| | 06:30 | You can preview your changes anytime,
when you are done close the Print Preview.
| | 06:34 | And from Design View, you have got
tons and tons of options at your disposal.
| | 06:39 | One last thing we are
going to do is put in our logo.
| | 06:42 | So I am going to go up here
from the Design tab. Select Logo.
| | 06:47 | I am going and get my
Logo from my Exercise_Files.
| | 06:51 | So you can too in your Exercise_Files.
| | 06:56 | Let's go back to the Lesson7
folder and grab that Logo and click OK.
| | 07:02 | You can see that it puts right on top
of my text, I am going to click on the
| | 07:07 | text, I am going to move it off to the
right and I am going to preview that.
| | 07:16 | Looks great and I am happy with my Report.
| | 07:18 | I close the Print Preview.
| | 07:21 | I save my changes to the customers Report.
| | 07:24 | And the next time I open it up, I
will see it the way I want to see it.
| | Collapse this transcript |
| Adding custom calculated fields to a report| 00:00 | So we know we can create
reports using the Report Wizard.
| | 00:03 | Go back and modify the design if we
want to, but there is another way to create
| | 00:07 | reports, a couple of different ways
actually, and depending on the table you
| | 00:10 | relate the report to, if there is
numeric data in that table, we could see some
| | 00:15 | calculations down for use as well.
| | 00:17 | I will show you how to do
that a couple of different ways.
| | 00:19 | If you are skipping to this lesson,
go to your lesson_08 folder of your
| | 00:22 | exercise_files, and open up AcmeReportC.
| | 00:26 | Once you got that open we are going to
go into the Orders Table, this is the one
| | 00:30 | we are going to base the report
on, so click the Orders Table.
| | 00:34 | You can see we have got some data in
here, and we have also got a currency
| | 00:39 | amount showing up here.
| | 00:40 | Wouldn't it be nice if we had a
grand total of all our totals?
| | 00:43 | That's what we are going to do next.
| | 00:44 | So we are going to create a report, I am
going to show you a fast and easy way to do this.
| | 00:49 | If we click the Report button right here
in the Report section on the ribbon, we
| | 00:53 | will create a quick-and-dirty report
based on the selected table, in our case,
| | 00:57 | the Orders table, watch this. Done.
| | 00:59 | So we have got all of the fields taken
from the Orders table and displayed here
| | 01:05 | in columns including the total
and look what happen automatically.
| | 01:09 | This was added up for us.
| | 01:11 | That we got a sum of all of
our orders. That's awesome.
| | 01:15 | So, how do we do that ourselves?
| | 01:16 | How did this happen?
| | 01:17 | Well, it's easiest to show you in Design View.
| | 01:21 | So let's go up to our view drop-down,
we will go Design View and you will see
| | 01:26 | what's happening here.
| | 01:27 | We have got a Report Header and we can
change the logo and the title etcetera.
| | 01:32 | There is our Page Header.
| | 01:33 | We have got labels for each of the actual
fields down below in the Detail section.
| | 01:38 | There is a Page Footer automatically
that is going to show us the current page
| | 01:41 | number at the bottom of every page and
then at the end of the very last figure
| | 01:46 | in the Total column, we will
see a sum of the total field.
| | 01:51 | So the word total here represents the field.
| | 01:53 | It's in square brackets, and in round
brackets, we have got next to the word sum
| | 01:57 | and the equal sign our actual calculation.
| | 02:00 | So if you knew that, you could type it in
here, but there is even better ways to do it.
| | 02:05 | So let's create another one
actually from scratch this time.
| | 02:08 | So we are going to close the Orders
report without saving out changes, and
| | 02:14 | instead, we are going to go up to the
Create Tab and create a report that starts
| | 02:20 | off blank right from scratch.
| | 02:22 | Blank report gives us a blank page and
now we have to actually go and select
| | 02:27 | what appears in this report.
| | 02:29 | So the first thing I am thinking, I
would like to see is the customer name.
| | 02:32 | So I am going to double-click First
Name here after selecting Customers to
| | 02:36 | expand that list of fields.
| | 02:38 | Double-clicking Customer ID
is going to pop that in there.
| | 02:41 | Do I really need Customer ID?
| | 02:43 | No, if I click up here and hit Delete on
my keyboard, I can remove anything that
| | 02:48 | shows up on my form.
| | 02:50 | I do want their first name, double-click,
and last name, double click, I
| | 02:55 | don't need any other Customer
information so I am going click the minus sign
| | 02:58 | now to collapse that.
| | 03:00 | I do want some order information.
| | 03:03 | So down here, I would like to see
the Product ID, Quantity, and Total.
| | 03:08 | I am going to double-click Product ID
because it's related to the products down below.
| | 03:12 | I am going to need that.
| | 03:15 | And then also from Orders I want
to see the Quantity and the Total.
| | 03:20 | It will be nice to see what that
product is next to the Product ID.
| | 03:26 | So I am going to click the plus sign
next to Products and choose the product
| | 03:30 | name, double-clicking it.
| | 03:32 | And it gets popped in over here on the
right-hand side, and I'd rather have that
| | 03:37 | over here next to my Product ID.
| | 03:40 | So when I click down here, I get that
all selected, I am going to slide it over.
| | 03:45 | You can see as I move there is a bar in between.
| | 03:49 | Soon as I hit Product ID, I am going to
release and it reorders things for me.
| | 03:53 | I am not in Design View here.
| | 03:55 | I am in Layout View.
| | 03:56 | When I come here and click the drop down,
I am going to go to Design view now to
| | 04:02 | make some additional changes, because
right now, I am not seeing a calculation.
| | 04:05 | You can see I have only got a Page
Header and a detail section, the Page Footer
| | 04:09 | is blank, and there is no
actual Report Header either.
| | 04:14 | So let's go back to this View drop
down and choose Report View to see the end
| | 04:18 | result so far, very plain just information.
| | 04:22 | You can see I do have numbers
showing up here but no total.
| | 04:26 | So back we go to Design View and I am
going to scroll over down at the bottom of
| | 04:32 | my screen here, so I can see the
Total field and I am going to click on it.
| | 04:35 | As soon as I do that, the Grouping &
Total section now is going to allow me to
| | 04:40 | select from the Totals drop down, so I
click that, and you can see my choices:
| | 04:45 | sum, average, I can count records and
values, minimum, maximum etc. I want to sum.
| | 04:52 | Watch what happens when I click sum.
| | 04:54 | It adds the Page Footer and the report
footer sections for me and there is that
| | 05:00 | calculation, excellent.
| | 05:03 | Now before we go back and look at a
very plain looking report, let's go
| | 05:06 | and change the style.
| | 05:07 | I am going to go up to the Arrange tab
and use Auto Format, and I am going to go
| | 05:12 | back to that Vista style.
| | 05:14 | There we go, in the Report Header it might
be nice if we had our logo and maybe a title.
| | 05:20 | So, I am going to go back up to the
Design tab up here, I am going to click Logo.
| | 05:25 | Now I am going to navigate to my
lesson_07 folder of exercise_files.
| | 05:30 | That's where we had a logo,
click on the Logo and click OK.
| | 05:35 | It inserts it for me and I would
also like to have a title in here.
| | 05:40 | This little icon up here
represents title. Click that.
| | 05:44 | You can see Report1 shows up.
| | 05:45 | I can double-click that to highlight it.
| | 05:47 | With it highlighted, I am going to
type in my own title, which is going to be
| | 05:55 | Order Totals, expands to accept my text
and I click outside to deselect, and it
| | 06:01 | looks like that coloring is going to
work with our background. So back in we go.
| | 06:05 | I am going to click-and-drag
to highlight everything.
| | 06:08 | We are going to change that
to a different font color.
| | 06:11 | Let's choose white.
| | 06:14 | That looks better, and maybe
if we wanted to put in some page
| | 06:19 | numbering, etcetera.
| | 06:20 | We can create a little space here by
clicking-and-dragging and in the Page
| | 06:24 | Footer section, you might
want to put the page number.
| | 06:28 | So Page N or Page N of M,
I am going to use this one.
| | 06:33 | We want it at the bottom
in the footer. Centered?
| | 06:36 | No, let's put it on the
right, and we will click OK.
| | 06:40 | So if I scroll over you will see that
that's been entered for me, and all we
| | 06:46 | need is that Sum Total in
there to show up nicely for us.
| | 06:49 | Let's check our view. Look at that.
| | 06:53 | Very nice.
| | 06:54 | So this looks way better than it did
before, but we started right from scratch
| | 06:58 | with a blank report, now you know how
to get the fields you need in there, from
| | 07:03 | different tables, to get the values
you want to show, and to total them up.
| | Collapse this transcript |
| Formatting reports| 00:00 | Whenever you create Reports in
Microsoft Access 2007, regardless of the method
| | 00:05 | you can always come back later and
make adjustments to Layout and Design.
| | 00:10 | That's what we are going to do in this lesson.
| | 00:11 | And we are going to use the Order
Totals report that we have created in
| | 00:15 | the previous lesson.
| | 00:16 | So if you have been following along you
should be in the right spot here, this
| | 00:19 | is the report we are going to modify.
| | 00:21 | If you are jumping to this
lesson, take a look at my Title Bar.
| | 00:24 | You can go to the Lesson8 folder of
your Exercise_Files and find AcmeReportD.
| | 00:29 | Open that one up if you got it
and you will be all caught up.
| | 00:32 | As I look at the end results of
this report where we used some auto
| | 00:36 | formatting, for example, I got some
empty space here I may not really need to
| | 00:41 | see in this report.
| | 00:42 | The Product ID, which is being used
to link tables in this report, doesn't
| | 00:47 | necessarily need to be viewed.
| | 00:49 | So I might want to make that invisible.
| | 00:51 | If you look over here under Customers,
Orders, and Products, I see the Order
| | 00:56 | Totals report in each one of
these table sections. Why is that?
| | 01:00 | Because I borrowed fields from each
of those tables to create this Report.
| | 01:05 | So, I need the Product ID which links
the two tables, Product and Orders but I
| | 01:10 | don't necessarily need to see the results.
| | 01:12 | So we can make that
invisible. That's one thing.
| | 01:14 | And maybe change up the look and feel
of this Report a little bit as well.
| | 01:18 | So with Order Totals selected, we are
going to change the layout first, let's go
| | 01:22 | up to our View drop-down and select Layout View.
| | 01:24 | Now, when I click this, right away I
have changed views obviously but the
| | 01:29 | Property Sheet has shown up here for me.
| | 01:31 | Now, this should be the default but
depending on what you did the last, if you
| | 01:35 | worked with Fields, for example
you may not see the Property sheet.
| | 01:38 | You may see the Field List or
you may not see anything at all.
| | 01:41 | To get the Property Sheet open, you can
come up here under Report Layout Tools.
| | 01:46 | Currently Format is selected for me.
| | 01:48 | There is also an Arrange tab and you will
see the Property Sheet button right here.
| | 01:52 | Alt+Enter on the keyboard is a
shortcut for displaying the Property Sheet or
| | 01:58 | hiding it if it's open.
| | 02:00 | So with the Property Sheet showing,
check out the different tabs depending on
| | 02:04 | what's selected, and let's just
click on our title, Order Totals.
| | 02:08 | It shows up here in the drop-down.
| | 02:10 | Now I can switch to any of those
objects in my Report by selecting them from
| | 02:14 | here, I am going to leave to at my Auto_Title().
| | 02:17 | This is created using the Auto Format
Tool and that's why it is called what it is.
| | 02:21 | Down below I have got
tabs for formatting my title.
| | 02:24 | I have got a Data Tab.
| | 02:26 | You can see I have only got Smart Tags.
| | 02:28 | It's not being used but we can
attach Smart Tags to a title.
| | 02:31 | We have got an Event tab so we can set
up events to happen when we click on our
| | 02:36 | title or double-click or mouse down,
up, or move over it with our mouse.
| | 02:41 | There is an Other tab as well.
| | 02:44 | We can put in Tips in
there, Shortcuts, etcetera.
| | 02:47 | And then if we want to see all of
those tabs all thrown together and all of
| | 02:50 | their options, we can choose the All
tab, check out the scrollbar, there is
| | 02:54 | great big long list of
properties we can play around with.
| | 02:57 | So we can change Fonts,
Alignments, Gridlines, Margins, etcetera.
| | 03:02 | I am going to scroll all the way up
to the top and move back to Format.
| | 03:06 | So I am okay with the actual format of
my title, but I am not okay with what's
| | 03:11 | happening down here.
| | 03:12 | I am going to click on Product ID, I
am going to go over to the right-hand
| | 03:16 | side and when I see the double arrow, I am
going to click and drag this in as far as it can go.
| | 03:21 | So I have closed up that gap, I don't
have that empty space showing up any more
| | 03:26 | but I do see some remnants here.
| | 03:28 | I have gone as small as I can go.
| | 03:30 | It might be best if I made this
invisible in my actual report.
| | 03:34 | So with it still selected, notice here
on the Format tab the second item down
| | 03:39 | for this label is Visible.
| | 03:42 | It's currently set to Yes.
| | 03:43 | I am going to click next to Yes
and change it to No by clicking the
| | 03:46 | drop-down and selecting No.
| | 03:48 | Now that's just the label, the data
down below, when I click on it with it
| | 03:53 | selected I can also make it
invisible by clicking next to Yes here in the
| | 03:57 | Visible row and from the drop-down selecting No.
| | 04:00 | All right, let's see
what that looks like so far.
| | 04:04 | If we go back up to our Home tab here
on the ribbon, and click the default
| | 04:08 | button when we are in Layout View,
which is the Report View button, you can
| | 04:12 | see the end result.
| | 04:13 | So we have closed up this gap,
everything has moved over for us.
| | 04:17 | So that makes this stuff
out of line a little bit.
| | 04:19 | So, let's go back now to the Design View.
| | 04:23 | This time in Design View we can work with
things like what shows up here in the Page Footer.
| | 04:29 | In Design View, you can see my
Property Sheet is still open.
| | 04:32 | I have got my Sum down here, I am
going to scroll over and this is what's out
| | 04:37 | of whack over here.
| | 04:38 | It's the code for my page number.
| | 04:40 | So I am going to click on that.
| | 04:41 | As soon as I move to the border here
and I see the four pointed arrow I can
| | 04:46 | click and drag to move this in.
| | 04:48 | I am going to move it in all the way over here.
| | 04:53 | So we can what that looks like by
going up to our Report View button.
| | 04:57 | It's kind of centered, now it's a long
field that's got a lot of empty space.
| | 05:02 | So, let's go back to Design View, and
with it still selected we can make changes
| | 05:10 | to it such as the alignment or even the width.
| | 05:13 | Right now, it's very wide and the page
number showing up over here almost looks
| | 05:17 | centered in our Report.
| | 05:19 | But you can see the right side of my
actual Control Box is lined up with the
| | 05:25 | right hand side of my Total,
my Sum down here, and my labels.
| | 05:32 | So let's just see if we can change the
alignment of the contents of this Control Box.
| | 05:36 | And down below you can see Text Align
here in my Format tab in the Property
| | 05:41 | Sheet is set to General.
| | 05:42 | I am going to click next to General,
click the drop-down and I am going
| | 05:45 | to choose right align.
| | 05:46 | So everything is lined up on the right.
| | 05:49 | Now, when I go up to my
Report View, check it out.
| | 05:52 | That's looking better.
| | 05:53 | So over here, underneath
my grand total, perfect.
| | 05:57 | Let's go back now to the drop-down, go
to Design View and up at the top here
| | 06:04 | where we got our Design tab, I would
like to go over to the Arrange tab and
| | 06:08 | check out some other AutoFormat options.
| | 06:11 | So, I am going to click this drop-
down and maybe you want to change the
| | 06:14 | whole look entirely.
| | 06:15 | Let's try this one called Metro, for example.
| | 06:17 | Now as soon as we do that we are
going to see a change in the AutoFormat.
| | 06:23 | Okay, color combinations are slightly different.
| | 06:26 | Let's go back again, try something
different, here is Northwind, for example.
| | 06:32 | Now we are only making
changes to what's selected.
| | 06:34 | Did you notice nothing is happening
up here in my Report Header or my Page
| | 06:38 | Header, because I have got something selected?
| | 06:41 | So, if I come down here and click,
so none of my fields are selected.
| | 06:45 | Come to the Auto Format and now
we will try Metro, for example.
| | 06:50 | The whole thing is affected.
| | 06:52 | So, it's very important to pay attention
to what's showing up here in the drop-down.
| | 06:56 | Any changes we make will only
be made to whatever is selected.
| | 06:59 | So, if it happens to be one of
those labels like Label1, whatever.
| | 07:04 | We wanted to say Report.
| | 07:06 | We can select Report from here.
| | 07:07 | It's an alphabetical list.
| | 07:10 | Or if we wanted to just click off of any
selected items to select the entire Report.
| | 07:16 | So, let's see what that looks like,
go up to our Home tab on the ribbon,
| | 07:20 | switch to the Report View.
| | 07:21 | That's much different.
| | 07:23 | And in fact, it doesn't really work
with that Product ID that used to be in
| | 07:27 | here, and you can see we have got a space.
| | 07:29 | So we would have further changes to
make in our Design View. We come in here.
| | 07:34 | Product ID is back. I click on it.
| | 07:37 | It's still not visible
but it is taking up space.
| | 07:41 | So I would have to come over to the
right-hand side and squeeze it right in.
| | 07:45 | Everything else closes up. Check it out.
| | 07:48 | That's much better even though there
is still a little bit of space there.
| | 07:52 | That's some thing I could live with.
| | 07:53 | I like the look of this Report now,
separating our customer information slightly
| | 07:58 | from the rest of the information.
| | 08:00 | And of course any time we make
changes like this to Layout or Design, it's
| | 08:04 | important that we come up and click
our Save button to save our changes.
| | 08:09 | So keep in mind although we are using
AutoFormatting and we are using Report
| | 08:13 | Wizards and all kinds of automation
Tools to create our Reports, we can always
| | 08:18 | come back later and modify both
Layout and Design by changing our Views to
| | 08:23 | Layout or to Design View and making
our change from the Property Sheets or we
| | 08:28 | can also go to our Field List.
| | 08:30 | Let's say we are missing a field on this report.
| | 08:33 | Let's go back to our Design View, and from
here we decide we need to bring in a new field.
| | 08:40 | We can get our fields by clicking the
Add Existing Fields button showing up
| | 08:45 | here on the right, and if I wanted, for
example, Phone number showing up on this Report.
| | 08:51 | I just simply drag this field in to my Report.
| | 08:54 | And I would want to have some space
for that, if I scroll over, you can see I
| | 08:58 | do have room for that.
| | 09:00 | Click and drag it down here.
| | 09:02 | There is my Phone number.
| | 09:05 | It has a label attached to it as well.
| | 09:10 | That's this part over here.
| | 09:12 | Clicking the Control Box allows me to
move it closer if I wanted to, or simply
| | 09:17 | delete that label if I don't need it.
| | 09:18 | I just want the number to show up.
| | 09:22 | If we look at this Report, you can see
Phone number is down the right-hand side.
| | 09:27 | If that doesn't make sense,
how do we take out fields?
| | 09:29 | Well, now that you know how to bring
them in, to take them out is even easier.
| | 09:33 | We just go in to the
Report itself, find the field.
| | 09:37 | If it's not already selected, click it.
| | 09:39 | Hit Delete on the keyboard.
| | 09:41 | Check out the end results. That looks good.
| | 09:45 | And we are done.
| | Collapse this transcript |
| Summarizing report information| 00:00 | If you have been following along in
this chapter, you know how useful reports
| | 00:03 | can be for displaying information
that exists across one or more tables.
| | 00:09 | The beauty of a report is that we
can take information from a couple of
| | 00:12 | different tables and put
it altogether in one place.
| | 00:15 | Look at my Order Totals report here.
| | 00:17 | It has grown since the last lesson
because I have added some new orders in here
| | 00:21 | to this particular database.
| | 00:23 | You will see that it's called AcmeReportE.
| | 00:26 | So if you have the exercise files and
you are following along, you'll want to
| | 00:28 | open up this database to
be all caught up with me.
| | 00:32 | Now, down below I have got
information that's coming from multiple tables.
| | 00:36 | I have got information
that's coming from the Customers:
| | 00:38 | Table, customer information.
| | 00:40 | I have got info coming from the Products:
| | 00:42 | Table as well as the Orders: Table.
| | 00:44 | It's all gathered
together here in one nice report.
| | 00:47 | What I haven't touched on
yet really is summarizing data.
| | 00:51 | Wouldn't it be nice to get a list of
all our customers by state for example and
| | 00:55 | get a running total of how many
customers we have in each state, or how about
| | 01:00 | their orders, even more important maybe
you want to total up all the orders by
| | 01:03 | state and total up how many
orders have come in from that state.
| | 01:07 | Well, we can do that by
summarizing data in a report.
| | 01:11 | We are going to do that in this lesson now.
| | 01:13 | So, the first thing we need to do is go
up to the Create tab and to get a head
| | 01:17 | start, we are going to create a
report using the Report Wizard.
| | 01:21 | That will give us a nice head start
and then we can go back and fine tune.
| | 01:23 | So I am going to click the Report
Wizard, I am going to make sure Customers
| | 01:28 | is the table that's selected right
here, if it is not, from the drop-down
| | 01:32 | just select Customers.
| | 01:34 | I want their Last Name to show up first,
I am going to click on it and then the
| | 01:37 | single arrow moves just that one
field over instead of all of them.
| | 01:41 | Then I want the First Name.
| | 01:43 | And I am going to be grouping them by State so I
need that State field as well. I will click Next.
| | 01:48 | Here is my grouping question.
| | 01:51 | Yes, I want to group them by State, so
I will select State and move it over.
| | 01:55 | I get a quick preview of what that's going
to look like, great, Next. How about sorting?
| | 02:02 | Well, I want to sort by Last Name and
then those with the same last name, I want
| | 02:06 | them sorted by First Name.
| | 02:09 | Great, I will hit Next.
| | 02:11 | How about the style or layout?
| | 02:13 | Well, I am going to leave it at
Stepped because as I click on Block and get a
| | 02:18 | quick preview and Outline, they
are not quite what I am looking for.
| | 02:21 | So I am going to leave it at Stepped.
| | 02:22 | But I do want the field widths to be
adjusted for me so that all the fields will
| | 02:26 | be able to fit on one page.
| | 02:27 | I am not too worried about that quite yet.
| | 02:29 | Click Next, we will choose a style now.
| | 02:33 | If we go up to -- actually I like the one
that was selected for me here, Technique.
| | 02:38 | Go ahead and select that one as
well and then we will click Next and we
| | 02:42 | will give it a new name.
| | 02:43 | It's not going to be called Customers.
| | 02:45 | It's actually going to be called Orders by
State because that's what's going to be summarized.
| | 02:51 | Let's preview the report, we know it's
not finished yet, but we will preview it
| | 02:54 | to see what that looks like so far.
| | 02:56 | So let me hit Finish.
| | 02:57 | You can see that they are
grouped by state. That's great.
| | 03:01 | These are the actual orders, perfect
and the customers themselves are not
| | 03:08 | showing up with any order
information at this point.
| | 03:11 | I do see a lot of space though.
| | 03:12 | So we are going to tighten up the
actual fields that are here so far and
| | 03:17 | add some new style.
| | 03:18 | So to do that, we are going
to close our Print Preview.
| | 03:22 | That returns us to the Design View.
| | 03:24 | You may or may not have a
window open here on the right.
| | 03:28 | It could be the Property Sheet or
it could be Add Existing Fields.
| | 03:32 | The one we really want is Add Existing
Fields, so make sure that that one is
| | 03:36 | showing up here from the Tools
section on the Design tab on the ribbon.
| | 03:42 | What we need to do first is add a field.
| | 03:45 | We need to get the total for the number
of orders that are being placed here by
| | 03:48 | each of the customers in
each of the various states.
| | 03:51 | I am just going to click down here in
the Report Footer, so nothing is selected.
| | 03:55 | Get my double arrow over here and just drag
to the right so I can see a little better.
| | 03:59 | I can see that Last Name here
and First Name are really too wide.
| | 04:02 | So I am going to click on the Last Name.
| | 04:04 | I want to create some room for my new field.
| | 04:06 | When I see the double arrow on the
right here, I can drag that across.
| | 04:09 | Now, I am going to go to about
two-and-a-quarter inches about.
| | 04:14 | First Name comes over with it, so I
am going to click on the First Name
| | 04:17 | field now and do the same when I see
the double arrow and I drag that over
| | 04:21 | to about the 4 inch mark.
| | 04:24 | That gives me some room now and I can
scroll over to see there is a quite a bit
| | 04:27 | of room there for me to add some fields.
| | 04:29 | The field that I want to add is
actually the total for the Orders table.
| | 04:34 | So the Orders table shows up over here.
| | 04:36 | You may have a plus sign
and if so you can expand it.
| | 04:39 | A minus sign means that it is
expanded and we can collapse it.
| | 04:43 | We need to see the fields in the Orders
table so we can click-and-drag Total up
| | 04:48 | here into the Detail section of our report.
| | 04:51 | And you can see what just happened there.
| | 04:53 | Total came over, there is where the
value is going to show up and there is
| | 04:56 | also a label and if I click on the label,
it's selected and the actual field itself is not.
| | 05:02 | Because I don't need the label, I am
just going to hit Delete and I am going to
| | 05:05 | move the Total field here as soon as I
see the four-sided arrow, I can drag it
| | 05:10 | up and over next to First Name, right there.
| | 05:15 | Perfect, I can close this up a little bit
because of too much space and that looks good.
| | 05:21 | So I click down here to deselect.
| | 05:23 | We can preview that by clicking the
Report View and you can see now I am getting
| | 05:29 | Quantity is showing up and because I am
looking at Orders, I am seeing duplicate
| | 05:33 | names here because each of the
orders is showing up for that customer.
| | 05:36 | That's what I want.
| | 05:38 | The next thing I want is the number of
orders for each of these states totaled
| | 05:42 | for me and then a total for all of the
orders that are being placed for that
| | 05:46 | state as well as a grand total.
| | 05:48 | So back we go to Design View and from here we
are done adding fields, we can close this up.
| | 05:56 | What we want to do is add some calculation.
| | 05:58 | So for example, if I click on Total
and I want to see totals by State.
| | 06:02 | Look what happens when I come up here.
| | 06:05 | Click on Totals and I choose Sum.
| | 06:10 | Something just happened because I
have got Grouping turned on by State.
| | 06:14 | A State Footer appears and down here you
can see I have got a sum total showing up now.
| | 06:19 | That's excellent.
| | 06:21 | Down below it's hard to see right
now but there is a grand total in the
| | 06:24 | Report Footer as well.
| | 06:25 | I am going to click down
here, so nothing is selected.
| | 06:28 | The other thing I want to do is just
get a running count of the number of
| | 06:31 | orders of by State.
| | 06:32 | So I am going to click on
either Last Name or First Name here.
| | 06:35 | It doesn't matter which one and I want
to count all the last names that show up
| | 06:39 | in each of these state sections.
| | 06:41 | So, with Last Name selected, I am going
to go up to my Totals drop-down again,
| | 06:45 | I don't have as many choices because it's
not a numeric field, but I can, Count Records.
| | 06:49 | So I am going to click on that.
| | 06:51 | You can see what happened.
| | 06:52 | Now a count is going to show up in the
State Footer as well and down below a
| | 06:56 | grand total of all the orders
showing up in the Report Footer.
| | 07:00 | All right, let's go up to our
Report button, or Report View button.
| | 07:05 | Look at that, so they are
grouped by state in alphabetical order.
| | 07:10 | Within there, you can see I have got
an alphabetical listing as well by Last
| | 07:13 | Name and then First Name.
| | 07:16 | For each of the states, I am getting a
running count of the number of orders, 5
| | 07:20 | of them in Pennsylvania, and then
over here you can see I have got totals
| | 07:25 | showing up underneath for each one of
the states as well as, grand total is very
| | 07:31 | hard to see down here with this
particular style, but it's down here in the
| | 07:35 | Report Footer section.
| | 07:36 | So 8 orders for a total of 241,296.
| | 07:38 | So you can see that, yes we can run
reports to gather information from various
| | 07:45 | tables and display it in one spot, but
we can also summarize that data using a
| | 07:50 | couple of calculations.
| | 07:51 | Report Wizard is always a great
idea for giving you a head start when
| | 07:55 | creating your reports.
| | Collapse this transcript |
| Creating a mailing label report| 00:00 | One feature I really like about
Microsoft Access is a built-in reporting
| | 00:04 | function specifically
designed for creating labels.
| | 00:08 | If you have been following in this
Chapter you know that our scenario here is.
| | 00:12 | We've got a number of customers placing
orders from all over the United States.
| | 00:16 | If we want to send something out to
our customers by mail, it would be handy
| | 00:20 | to create mailing labels since we
have all of their information in the
| | 00:24 | Customer's table already.
| | 00:26 | Well, instead of creating a Report
from scratch designing the label and
| | 00:31 | measuring the size and trying to make
it fit when it prints, while there is a
| | 00:34 | built-in function specifically for
creating those labels and drawing that
| | 00:39 | information out of an existing table.
| | 00:41 | That's what we are going to do right now.
| | 00:42 | If you are jumping to this lesson and
you haven't been following along, you can
| | 00:45 | open up a database called AcmeReportF.
| | 00:47 | It's in your Lesson 8 folder of the
Exercise Files, if you've got them.
| | 00:53 | And once you open that up it really
doesn't matter what shows up on your screen here.
| | 00:56 | We are seeing a Report that we created
in the previous lesson here on my screen.
| | 01:00 | But really what we want to do is click
on the Customers:Table because that's
| | 01:05 | where the information lies that's going
to be used for our new report that will
| | 01:09 | simply be a number of labels.
| | 01:11 | Next, I want to make sure the Create
tab is selected before we go over to the
| | 01:16 | Reports section, we are not going to use
the Report Wizard or the Report button,
| | 01:20 | not even a Blank Report.
| | 01:21 | We are actually going to use this one
here, Labels designed specifically for
| | 01:25 | creating our mailing labels.
| | 01:29 | So, the Label Wizard begins.
| | 01:31 | The first thing I like to do is
take my box of labels and look at who
| | 01:34 | the manufacturer is.
| | 01:35 | So, I come down here and Filter by
manufacturer, I am going to choose Avery.
| | 01:40 | So, if that's showing up there by
default that's fine, but look at the long list
| | 01:45 | of manufacturers we have here.
| | 01:47 | Lots to choose from.
| | 01:49 | Yours is likely to be on that list.
| | 01:51 | You just select it and that means that
what you are going to see up here for
| | 01:53 | Product numbers corresponds to the manufacturer.
| | 01:57 | All right, so I have got
a number of options here.
| | 02:00 | I kind of like this one here, 5395,
all right again, look at my box and if
| | 02:06 | that's the product number I see,
that's the one I want to select, because the
| | 02:09 | dimensions are already set out for me here.
| | 02:12 | You can see its two labels across and
then there is a number of rows of label as
| | 02:16 | well, depending on what you
choose for the label type.
| | 02:19 | Now Sheet feed is what's likely going
to be selected for anyone with a laser
| | 02:24 | printer or an inkjet style printer.
| | 02:27 | If you are using the old Dot Matrix you
might wan to choose Continuous, but most
| | 02:31 | often it's going to be Sheet feed.
| | 02:33 | We are going to click Next and now
we get to choose our text appearance.
| | 02:37 | You can see my default here an
Arial font and the font size is 8.
| | 02:42 | Yours may be the same or
different, but we can change that.
| | 02:46 | That's the important thing
and there is our font list.
| | 02:49 | I am going to go all the way down my
list into the V's and I am going to
| | 02:53 | choose this one here.
| | 02:56 | Font size, I am going to bump it
up to 10 and I am going to leave the
| | 03:01 | Font weight at Light.
| | 03:02 | The Text color though I may change, I
can click right in here where it says
| | 03:06 | Text color, right on the little
button to bring up a color swatch and I am
| | 03:10 | going to choose a dark blue.
| | 03:12 | I do have a color printer,
so this will work for me.
| | 03:15 | All right, I don't need it to be
Italics or Underline, I will click Next and
| | 03:20 | now I get to choose the fields from the
Customer:Table that I am going to use for my label.
| | 03:26 | I want FirstName, so I am going to select that.
| | 03:29 | You can see what happens.
| | 03:31 | I need to leave a space after the
FirstName, so I hit the Spacebar on my keyboard.
| | 03:35 | LastName is already selected.
| | 03:36 | I will move it over.
| | 03:37 | I am going to press Enter to
move down to the next line.
| | 03:41 | That's where the Street goes.
| | 03:42 | I am going to press Enter again,
because that's where the City comes.
| | 03:47 | It's already selected.
| | 03:48 | Scroll down, State comes after the City,
but before I put in the State, I am
| | 03:54 | going to put in, right here by
clicking after City a comma and a space, so I
| | 03:59 | can do this formatting.
| | 04:01 | Now, I am going to put in the State.
| | 04:02 | I am going to leave a space after the
State and that's where I am going to put
| | 04:06 | in the Zip code, already selected, there we go.
| | 04:10 | When I click Next, I move on to the next
screen and I get to choose now how I am
| | 04:15 | going to sort my Labels.
| | 04:16 | And I'd like to sort them by LastName.
| | 04:21 | Anyone with the same LastName,
secondary sort is going to be on the
| | 04:25 | FirstName and Next.
| | 04:29 | Labels Customers is going to be the
default name for this particular Report and
| | 04:33 | I am fine with that.
| | 04:35 | My options down below, when I hit Finish,
we will be to see the Labels as they
| | 04:38 | will look when they are printed
or to modify the label design.
| | 04:42 | Well, before I modify anything I
should see what it's going to look like.
| | 04:45 | So, I am going to hit Finish.
| | 04:48 | I do get this dialog coming up that
there is not enough horizontal space on the
| | 04:52 | page for the number of columns
and column spacing that I specified.
| | 04:56 | Here I can click the Page setup on the
File menu, click the Columns tab and then
| | 05:00 | reduce the number of
columns or the size etcetera.
| | 05:02 | It's giving me some hints, if I need to go
back into my Design View and make some changes.
| | 05:07 | I am going to click OK.
| | 05:08 | This actually looks okay.
| | 05:10 | If I zoom out, you will notice that my
mouse pointer is a Zoom Tool with a minus
| | 05:14 | sign, which means one-click will zoom
me out and there you can see what my
| | 05:18 | Labels are going to look like when they print.
| | 05:19 | I am going to click again to zoom in
right to the middle here and scroll up and
| | 05:26 | that just saved me a ton of time.
| | 05:29 | So, a built-in reporting function that
allows you to create mailing labels in a jiffy.
| | 05:34 | Of course, we can go back now if we wanted to
by closing the Print Preview into the Design.
| | 05:39 | You can see what the Report design looks like.
| | 05:41 | And this is all based on what we
selected for the Manufacturer and the Product
| | 05:46 | number for our Label.
| | 05:48 | We don't really want to fiddle around with that.
| | 05:50 | Everything seems to fit okay, so we
are all right to go up and save this and
| | 05:55 | use it anytime we need.
| | 05:57 | The neat thing is that you will see that
under the Customers section here, under
| | 06:01 | All Tables, we have got
our Labels Customers Report.
| | 06:05 | As we add new customers over time, each
time we run this run report, we'll get
| | 06:10 | a bigger and bigger list of customers and
more and more labels printing out each time.
| | 06:15 | So, we don't have to come in
here and update this at all.
| | 06:17 | We just have to add our customers and
know that the next time we need to send
| | 06:20 | out something by mail, all of our
customers are going to print out on their
| | 06:24 | very own label.
| | Collapse this transcript |
| Printing reports| 00:00 | If you've been following along in this
chapter dealing with reporting, you know
| | 00:04 | reports are great way to display your
data, gather data from multiple tables,
| | 00:08 | put it altogether in one place.
| | 00:10 | We can summarize our data, run
calculations on it, even create mailing labels in
| | 00:15 | a report like we did in the previous lesson.
| | 00:18 | Well, then you might be thinking the
next logical step is going to be what, to
| | 00:22 | print out those reports.
| | 00:23 | Think about mailing labels.
| | 00:25 | They're designed to be printed, aren't they?
| | 00:27 | You wouldn't just view them on the
screen, once you've got the report and it
| | 00:30 | looks good, you send it to the
printer, peel off the label, put it on the
| | 00:33 | envelope and send them off.
| | 00:34 | So we're going to talk about printing now.
| | 00:36 | In the previous lesson, we created
this report called Labels Customers.
| | 00:40 | It is a mailing label, and
this is what we're going to print.
| | 00:43 | If you're jumping to this lesson and
you haven't created this report yet, go
| | 00:47 | ahead and navigate to the Lesson 8
folder of your exercise files and open up
| | 00:51 | this database called AcmeReportG.
| | 00:54 | Next, you'll click on Labels Customers,
and you'll go up to your View button and
| | 00:58 | change to Design View to
be all caught up with us.
| | 01:01 | Now before we just go up to our Print
button up here on the Quick Access Toolbar
| | 01:05 | and give it a click, that
would just send our mailing labels.
| | 01:09 | We have no idea, really,
if it's going to look right.
| | 01:12 | I like to get a print preview before I
send something to the printer, especially
| | 01:16 | mailing labels, which can be expensive,
and if they're not lined up properly,
| | 01:20 | they don't look right, then
you've just wasted a sheet of labels.
| | 01:23 | So to get to print preview, there are a
couple of different ways we can do that.
| | 01:27 | We can go to our View dropdown, and
from the dropdown select Print Preview.
| | 01:31 | That will show us what our report
is going to look like, in this case,
| | 01:35 | our mailing labels.
| | 01:36 | It also shows us the Print Preview
ribbon, where we've got a bunch of options.
| | 01:41 | We talked about those in a previous lesson.
| | 01:43 | Another way to get to print preview,
I'm going to close print preview here.
| | 01:48 | I'm going to go up to my Office
button, down to Print and select Print
| | 01:53 | Preview from there.
| | 01:55 | So exact same thing, I'm in Print Preview now.
| | 01:57 | I've got the Print Preview ribbon.
| | 02:00 | I'm going to close it and show you one last way.
| | 02:02 | And that's from the Design View that
we're in, is to come over here to the Tools
| | 02:08 | section on your ribbon.
| | 02:09 | This little guy here is called
the First 10 Records Preview.
| | 02:13 | It's really the same thing, takes us
to the Print Preview ribbon, where we've
| | 02:16 | got all of those options
for previewing our report.
| | 02:20 | So once it looks good, you'll notice
that my mouse pointer here in Print Preview
| | 02:24 | is a magnifying glass with a Minus sign.
| | 02:26 | I can zoom out to get a feel
for the entire page, looks good.
| | 02:30 | It's going to work.
| | 02:31 | Now my mouse pointer is a
magnifying glass with a Plus sign.
| | 02:34 | I can zoom back in.
| | 02:36 | I just want to talk about these quickly.
| | 02:38 | Under Page Layout, I can change the Page
Size, the orientations from Portrait to
| | 02:43 | Landscape, the Margins, the Columns,
all of that, even the entire Page Setup.
| | 02:47 | But I want you to remember what
we did in the previous lesson.
| | 02:50 | We used the Labels function to create
this report, selected our manufacturer,
| | 02:54 | the product ID, so all of these
settings are set up for us and they match what
| | 02:59 | we have in our printer
right now waiting to be printed.
| | 03:01 | So you really don't want to go in here and
fiddle around too much with these settings.
| | 03:06 | Now on occasion, you might end up with an
address, for example, that's just too wide.
| | 03:10 | You're running out of space.
| | 03:11 | You could come into the Page
Setup and change the Margins.
| | 03:15 | Give yourself a little more space, but
you wouldn't want to change your page or
| | 03:19 | your column settings, because they
were all set for you during that routine
| | 03:23 | where we set up our mailing labels
using the built-in functionality.
| | 03:27 | So I'm going to click OK.
| | 03:29 | All I need to do now is actually print this.
| | 03:32 | I can do that from the Office button.
| | 03:34 | But I can also do it from the ribbon here.
| | 03:36 | The very first button is my Print button.
| | 03:38 | So I give that a click.
| | 03:40 | We get the Print dialog box.
| | 03:42 | You can see my default printer, that
can be changed from here if I need it to.
| | 03:47 | If I want to print all, that's the
default as well, but if I only want to print
| | 03:51 | certain pages or selected
records, I could do that.
| | 03:54 | Right now, I only have enough records to
fit on one page, so I don't get these options.
| | 03:59 | I can change the number of copies though.
| | 04:01 | If I wanted more than one copy of
this sheet of labels, I could pump it up.
| | 04:05 | I'm going to pump it back down.
| | 04:08 | But when I'm ready to print and I've
got my mailing labels in the printer
| | 04:11 | already, you want to make sure
that you do that before clicking OK.
| | 04:16 | Clicking the OK button will
send it off to the printer.
| | 04:19 | As it prints away, I'm still in Print Preview.
| | 04:21 | I'm going to close my print preview,
returns me back to my previous view, which
| | 04:25 | was the Design View.
| | 04:27 | I want to make sure if I made any
changes to save by clicking the Save button,
| | 04:31 | and I'm ready to move on.
| | Collapse this transcript |
|
|
9. Working with MacrosCreating macros| 00:00 | It's time now to talk about Macros in
Microsoft Access 2007, and Macros in
| | 00:05 | Access are a little bit different
than Macros you may be used in another
| | 00:08 | applications like Microsoft
Word and Excel for example.
| | 00:12 | In those applications, a Macro is basically
a recording of keystrokes and mouse-clicks.
| | 00:17 | Well, in Access, Macro is actually
going to be a recording of actions whenever
| | 00:23 | we run a report or send that
report to the printer, for example.
| | 00:27 | Those are actions that
take place in our database.
| | 00:30 | Well, we can create a Macro to automate
some of those tasks and just make life a
| | 00:34 | little bit simpler for ourselves.
| | 00:36 | That's what we are going to do now.
| | 00:37 | You will notice up at the top in
the title bar I've got a database open
| | 00:41 | called CustomerOrdersA.
| | 00:43 | If you've got exercise files, you can go
to the Lesson 9 folder and open up this
| | 00:47 | database first and then what we will do
is come over to our Navigation Pane here
| | 00:52 | and click on the Customers form.
| | 00:54 | So we saw this from a previous lesson.
| | 00:57 | We even created a Command
button here to print out our form.
| | 01:02 | What if we wanted to view a report now?
| | 01:04 | We could create a button right
below the Print button that opens up the
| | 01:08 | Customers Phone List for example,
so we don't have to do it manually.
| | 01:12 | We can do it right from here.
| | 01:14 | If we are going to be creating an
application that users are going to use this
| | 01:17 | form to input new customers, they may
want to, at any time be able to look at
| | 01:21 | the Customers Phone List report.
| | 01:23 | So let's automate that.
| | 01:24 | The first thing we need to do is go up
to the Create tab and way over here on
| | 01:30 | the right, you are going
to see a Macro drop-down.
| | 01:32 | If I click the drop-down, you will
see I have got Macro, which is the
| | 01:36 | default button up here.
| | 01:37 | I can also create Modules and Class Modules.
| | 01:40 | That's fairly advanced and
would be saved for another title.
| | 01:44 | So we are going to go right up to
Macro and we are going to give it a click.
| | 01:46 | It opens up the Macro1 tab.
| | 01:49 | We haven't saved our Macro and given it a name.
| | 01:51 | So this is the default that shows up
here, Macro1 and you can see some columns.
| | 01:55 | You got an Action column.
| | 01:56 | We have got a Comment column and I
skipped over this one called Arguments,
| | 02:00 | because this is brand new to version 2007.
| | 02:04 | You can't go in to the Arguments
column and make any changes and any edits,
| | 02:08 | but you can view the Arguments that are
being created depending on the action you choose.
| | 02:13 | So as I mentioned, we wanted to make
it so that the users inputting data into
| | 02:17 | the Customers form can quickly run
a report called Customer Phone List.
| | 02:21 | So that's going to be the action.
| | 02:23 | I am going to click the drop-down here
and you can see I've got quite a long list.
| | 02:27 | It's an alphabetical list of all the
things, all the actions that can take
| | 02:31 | place in this Macro.
| | 02:32 | And of course, a Macro
can be a series of actions.
| | 02:34 | You can see I can close up the database.
| | 02:37 | I can use the Find feature.
| | 02:39 | Here is the GoTo feature.
| | 02:42 | I am going to scroll down and
down here in the Open section.
| | 02:47 | You can see I can open Forms, Queries,
Reports, Tables. There is Report.
| | 02:50 | OpenReport is what I am going to
click on and you are going to see
| | 02:54 | some arguments show up.
| | 02:55 | I can't edit those, but down below in
the Action Arguments section is where I
| | 02:59 | actually choose the report that I want to open.
| | 03:02 | So where it says Report Name, I am
going to click just at the right.
| | 03:05 | That gives me a drop-down that I can
click on to choose from the reports in
| | 03:09 | this database and the one that I do want to
run or open up is the Customers Phone List.
| | 03:15 | So I am going to give that one a click.
| | 03:17 | The view that it comes up in will be a
Report view by default, but if I wanted
| | 03:21 | it to come in Print Preview for
example, so it would be fast and easy to
| | 03:24 | print, I can change the view by
clicking this drop-down and I am going to go
| | 03:29 | down to Print Preview.
| | 03:30 | You can see the other views are
there as well, Print, Design, Layout.
| | 03:35 | We will choose Print Preview.
| | 03:38 | Now if I want to apply a filter that
would exist in a query for example, I
| | 03:42 | could do that here.
| | 03:44 | I can add conditions.
| | 03:45 | That's a little bit more advanced, so
we are going to save that for later.
| | 03:48 | Right now, we are done with our Macro,
so we will go up to the Save button first
| | 03:52 | and we will give it a name.
| | 03:55 | So this one is going to be a Macro that
runs a report, so let's do Phone List.
| | 04:01 | PhoneListReport just like
that and we will click OK.
| | 04:08 | Now it doesn't need to show up on the
form like that, but it just helps us in
| | 04:11 | the Navigation Pane to understand what this
Macro does when we see it over here on the left.
| | 04:16 | All right, to run this report now, all
we have to do is come up here to the Run
| | 04:20 | button to test it out and when I
click the Run button, look what happens.
| | 04:25 | The Customers Phone List is opened up for me.
| | 04:28 | Notice also that I am in Print Preview
mode here and I can close the Print Preview.
| | 04:33 | It takes me back to my Macro and I am
done with this Macro, so we are going to
| | 04:39 | test it out in our Customers form.
| | 04:41 | So when I close this Macro by right-
clicking and selecting Close, I am taken
| | 04:48 | back to my Customers form.
| | 04:49 | All I need to do now is attach
this Macro somewhere to this form.
| | 04:54 | That's what we are going
to do in the next lesson.
| | Collapse this transcript |
| Attaching macros| 00:00 | The very first step in using a Macro
is to obviously, create that Macro.
| | 00:05 | That's what we did in the previous
lesson and now it's time to take the second
| | 00:09 | step, which is to attach it to
something to make it easily accessible.
| | 00:13 | So in our scenario here, where we are
going to have users entering customer
| | 00:17 | information into this Customers form
that you see on my screen here, we want to
| | 00:21 | build in some kind of automation so
that they can run this Macro called
| | 00:25 | PhoneListReport that we created in the
previous lesson and we know that that
| | 00:28 | actually launches a report, the
Customers Phone List report in a Print Preview
| | 00:34 | screen, so it's easy to print out.
| | 00:36 | So we are going to build-in the
automation by attaching the Macro to this form.
| | 00:40 | We will create a button that allows us
to do that and then for our users who are
| | 00:44 | entering the customer information, it
will be easy just to click a button and be
| | 00:47 | able to print out that phone list.
| | 00:50 | So let's do that now.
| | 00:51 | If you have been following along in the
previous lesson, you created the Macro.
| | 00:54 | We are looking the Customers form.
| | 00:56 | If you are jumping to this lesson, and
you have got the exercise files, go to
| | 01:00 | your Lesson_9 folder and
open up CustomerOrdersB.
| | 01:03 | You will find it in there and once
you have got it, go over here to the
| | 01:08 | Navigation Pane and click on the Customers form.
| | 01:11 | You will be all caught-up with us.
| | 01:11 | In the previous lesson, we added a
button here, which is Quick Print button that
| | 01:17 | prints out the form.
| | 01:18 | We added that not as a
Macro, but just as an Action.
| | 01:21 | Now we know that from the previous
lesson on Macro is at least one or more
| | 01:26 | Actions strung together
into one automated process.
| | 01:30 | So what we are going to do is add our
new Macro button down here and we do the
| | 01:34 | exact same thing that we
did to add this Print button.
| | 01:37 | We switch to Design View for our forms,
so we will go up to the View button,
| | 01:41 | click the drop-down and select Design View.
| | 01:43 | I am going to slide over here to the
right, so I can see where that Print button
| | 01:49 | is because I want to put it right
underneath and we come up here to the Control
| | 01:52 | section on the ribbon and click on the Button.
| | 01:55 | So I am just going to click-and
-drag a box here and release.
| | 02:00 | Now that's just a starting point.
| | 02:01 | I can adjust that later.
| | 02:03 | You can see over here in my Command
Button Wizard, because I have got this
| | 02:07 | button selected up here, I have got
some options for Record Navigation, Record
| | 02:13 | Operations, Form Operations that's
what we used earlier to print a form.
| | 02:18 | There is Report Operations as well.
| | 02:21 | I am not actually going to open the
report and then switch to Print Preview.
| | 02:24 | We've got all of that together in one Macro.
| | 02:27 | So we are going to come down to Miscellaneous
down here and choose to run a Macro instead.
| | 02:33 | When I hit Next, I get to
choose which Macro I am going to run.
| | 02:38 | Now there is only one Macro in this
database, so it's listed right there.
| | 02:42 | It's already highlighted.
| | 02:43 | I just have to hit Next.
| | 02:45 | Now do I want it to show text on the
button or would I rather have a picture there?
| | 02:50 | Well, let's try Text just
to see what that looks like.
| | 02:52 | We will type in PhoneList
and then we will hit Next.
| | 03:00 | Now we get to name our button and
that's only to make it easy for us.
| | 03:03 | Nobody sees this but us, the designers
of the database, so we understand what
| | 03:07 | our different buttons do and
we look at all of those objects.
| | 03:10 | Right now, it just says Command46.
| | 03:12 | We are just going to be PhoneListMacro.
| | 03:15 | That's what I am going to type in.
| | 03:18 | That will help me remember what this
button is for and then I will hit Finish.
| | 03:22 | So you can see what happens here.
| | 03:24 | I have got my button.
| | 03:26 | Right now, the text color is not
working very well for me, because it's a white
| | 03:30 | on a very light gray, so I can change that.
| | 03:32 | If I click inside the button here and
highlight, you can barely see Phone List in there.
| | 03:37 | I am going to change my font color.
| | 03:39 | I am going to a black and I am going to
size this a little bit differently, make
| | 03:48 | it a little bit taller.
| | 03:49 | Let's see if we can squeeze it
in to two lines, just like that.
| | 03:53 | We will line it up underneath our
Print button and I am going to deselect by
| | 03:58 | clicking outside the selected box to
see what that looks like. Interesting.
| | 04:02 | So all we need to do now is save our changes
to our form, because we are in Design View.
| | 04:06 | We need to save those changes and
let's switch back to the Form View.
| | 04:11 | This is where we started.
| | 04:12 | Now underneath our Print button,
we have got our Phone List button.
| | 04:15 | Let's see if that works.
| | 04:17 | We will click Phone List.
| | 04:18 | It runs the Macro, which opens up in Print
Preview, our Customers Phone List report.
| | 04:25 | We can zoom in and zoom out just like
we did when we created this report and if
| | 04:30 | we wanted to, it would be nice
and easy just to print it off.
| | 04:34 | I am going to click the Close Print Preview,
which is going to return me to my form.
| | 04:40 | So you can see how this would be
very useful as a user is entering new
| | 04:44 | customers, obviously, the phone list
is being updated and they can run that
| | 04:49 | phone list even printed quite easily
with some automation that we built in using
| | 04:53 | an existing Macro, we just simply
attached it to the form where it's easy for
| | 04:58 | our user to get access to.
| | Collapse this transcript |
| Automating data entry with macros| 00:01 | I've got to tell you.
| | 00:01 | We could devote an entire title to
working with Macros in Microsoft Access 2007
| | 00:06 | and it would be hours long.
| | 00:08 | Well, we are not going to go into that
much detail in this title, but I do want
| | 00:11 | to cover a couple of scenarios where
Macros can be very useful, and one of those
| | 00:15 | scenarios is automating data input.
| | 00:18 | So if you have got users who are going
to be inputting information into various
| | 00:22 | tables using forms that you have created
for example, and you want to build some
| | 00:26 | automation into that, you
can use Macros to do it.
| | 00:29 | So here is the typical scenario.
| | 00:30 | Let's say that most of our customers
reside in the area or let's say the city
| | 00:35 | where our business exists.
| | 00:37 | So I am going to use Manotick, PA for example.
| | 00:40 | Now every time we add a new customer
where the city is Manotick, wouldn't it be
| | 00:43 | nice if the state PA was filled in for
us and we are automatically taken to the
| | 00:47 | next field, the Zip code
where we can enter that?
| | 00:50 | That's what we are going to do in this lesson.
| | 00:52 | We are going to build a Macro that
recognizes the city, inputs the state for us,
| | 00:56 | and then moves on to the next field.
| | 00:59 | So the very first thing you will need
to do if you are skipping to this lesson
| | 01:02 | is open up CustomerOrdersC from the
Lesson 9 folder of your exercise files.
| | 01:07 | And if you have been following along
and you have the exercise files, you can
| | 01:10 | keep the existing database open.
| | 01:12 | So we are going to use the customers
form, but we need to flip to Design View.
| | 01:16 | And another thing that's kind of cool
about Access 2007 is we can embed the
| | 01:21 | Macro right here in the form, we don't
have to create a separate object like we
| | 01:25 | did in the previous lesson.
| | 01:26 | We will just embed it right here by
selecting the field that we want to run the Macro on.
| | 01:31 | In this case it's the City field.
| | 01:33 | So when I click on City, I want to
make sure that the Property Sheet is open.
| | 01:36 | So if it's not, click the Property
Sheet button, so you can see all of the
| | 01:40 | properties over here.
| | 01:41 | What we want to do is as we exit this
field, if the city is equal to, in our
| | 01:47 | case Manotick, we want the State field
to be populated with PA and we want to
| | 01:52 | the take the user straight to the Zip field.
| | 01:55 | So with City selected, we are going
to come over here to the On Exit event.
| | 02:01 | So if the Event tab is not
selected, give it a click.
| | 02:04 | Go to the right of On Exit and click in there.
| | 02:07 | Next thing we are going to do is build a Macro.
| | 02:09 | So we are going to click on the
ellipses here, and with Macro Builder
| | 02:14 | selected we will click OK.
| | 02:15 | So you can see here I have got some
columns, I have got the Action column,
| | 02:20 | Arguments, that's new in 2007, and we
got a Comment column over here as well.
| | 02:24 | The other one that we need
is the Conditions column.
| | 02:26 | So I am going to click on that and then
something that's very important for this
| | 02:31 | particular scenario where we are
going to be setting a value for a specific
| | 02:35 | field is to show all actions.
| | 02:37 | By default, if we come into the Action
column here and click the drop-down, we
| | 02:41 | are only going to see Actions that
are safe according to Microsoft Access.
| | 02:46 | So what we are going to do
is choose Show All Actions.
| | 02:49 | That's going to increase the list of
possibilities here including one that we
| | 02:53 | are going to need in a moment.
| | 02:54 | The first thing I am going to do though
is use the first row here for a comment
| | 02:58 | only, and the comments is just
going to remind me what this Macro does.
| | 03:02 | So it Sets State value to PA when
Manotick is entered in City field.
| | 03:19 | That's just for my own purposes.
| | 03:21 | I am going to go to the next
row and set up the Condition.
| | 03:24 | So the Condition, I can type this in if
I know how to code it properly or if I
| | 03:29 | wanted to I could use the Builder.
| | 03:31 | Well, I know how to type these in.
| | 03:33 | You can do the same thing
using your own city, if you like.
| | 03:36 | So I am going to put in [City].
| | 03:40 | That's the name of the field.
| | 03:43 | In and I am going to put in a round
bracket and each of the cities I enter here
| | 03:48 | have to be in double quotes, and I
can do more than one, if I wanted to.
| | 03:54 | Let's say Harrisburg is
another option. It's very popular.
| | 03:57 | I could add that too.
| | 03:59 | It's also in PA and I am going to
close it up with a round bracket.
| | 04:02 | So you could see I could enter
as many cities here as I want.
| | 04:06 | So what is the action when one of the
cities equal Manotick or Harrisburg.
| | 04:10 | Well, the action when I click the drop
down is to set a value, but not in this field.
| | 04:14 | In another field.
| | 04:15 | So watch what happens.
| | 04:17 | Remember, this is the On Exit command or Event.
| | 04:21 | So I am going to scroll all the way
down to find SetValue. There it is.
| | 04:26 | I won't see that unless Show
All Actions is selected up here.
| | 04:30 | And the SetValue gives me some
options down below, Item and Expression.
| | 04:37 | So I am going to click in the Item
field and you can see I have got a little
| | 04:41 | Builder over here as well.
| | 04:44 | But really all I want to do is set it
up so that the state is going to show up
| | 04:48 | with a certain value.
| | 04:50 | So I know that fields have to be in
square brackets, I am going to type in
| | 04:53 | state, close it up with a square bracket.
| | 04:56 | And then down below the Expression.
| | 04:58 | Again, I have got a Builder if I want help.
| | 05:00 | But I am going to just type in
"PA" like so. And I am done.
| | 05:07 | Well, almost done.
| | 05:10 | The next thing that I want is for
Access to take me to the Zip code
| | 05:15 | field automatically.
| | 05:17 | So I am going to click in the next row
down here and what I am going to do is
| | 05:22 | add in a command or a condition that
continues from the previous condition.
| | 05:28 | I don't know if you understand that,
but all we need to do, when you look
| | 05:33 | down here in the bottom right corner is
Enter a conditional expression in this column.
| | 05:37 | Type three periods to apply the
condition from the previous row.
| | 05:42 | So I want this and then ...
| | 05:44 | I am going to come over to the Action
column here and I am going to choose a
| | 05:51 | GoToControl right here and the control
-- I am going to click down here and the
| | 05:58 | control that I am going to is my Zip
code, which of course because it's a
| | 06:03 | field or a control.
| | 06:04 | It goes into those square brackets.
| | 06:06 | I type in Zip, close it up.
| | 06:09 | I am going to click over here.
| | 06:11 | If I want to add a comment, I could.
| | 06:14 | It ... goes to Zip field after entering PA.
| | 06:24 | All right, I need to do now is save this.
| | 06:27 | You can see up here, by default because
I am working with the City field in my
| | 06:31 | Customers form, I have got Customers:
City:On Exit showing up. That's fine.
| | 06:36 | If I want to change the name, I could.
| | 06:38 | I am going to hit Save and
we are going to test this out.
| | 06:42 | So I am going to close this.
| | 06:44 | I am going to go to my Form View and
I am going to try adding a new record.
| | 06:53 | So from here, let's see what happens if
I come into the City field and type in
| | 06:57 | Manotick and press Enter.
| | 06:59 | You can see what happened.
| | 07:00 | PA was entered for me and
it took me right over to Zip.
| | 07:04 | So two things are going to happen when
we automate things for users like this.
| | 07:08 | One, it's going to save some time.
| | 07:10 | I don't have to stop at this
field and enter PA every time.
| | 07:13 | Another thing that's going to happen
is I am going to have accurate data.
| | 07:17 | So I won't be able to get a spelling
mistake put in here, and maybe Pennsylvania
| | 07:21 | would be typed up by someone when it
should be PA or Pa which could make a
| | 07:26 | difference later on when we do
filtering and sorting and searching for records.
| | 07:32 | So one of the scenarios that is very
useful when using Macros in Microsoft
| | 07:36 | Access 2007 is to build some
automation into data entry like we did here.
| | 07:41 | Use your imagination.
| | 07:42 | Come up with your own using some of
the rules and some of the techniques you
| | 07:47 | learned in this lesson.
| | Collapse this transcript |
| Validating data with macros| 00:00 | Another great use for Macros in
Microsoft Access is to validate your data.
| | 00:05 | That is to ensure its correctness.
| | 00:07 | Here's a scenario, let's say we have
somebody entering orders for us in a form
| | 00:11 | that we created called Orders and the
information that goes into the Order form
| | 00:15 | populates the Orders table.
| | 00:17 | But we wouldn't want someone entering
information and moving on to the next
| | 00:21 | order if they hadn't filled
in all the required fields.
| | 00:24 | For example, let's say they
filled out everything except the
| | 00:27 | Product information.
| | 00:28 | Well, then we would have an order in our
Orders table with no products to be ordered.
| | 00:32 | That wouldn't make sense.
| | 00:34 | So we can create a macro that sends
up a message saying that they have left
| | 00:37 | something blank, send them back to that
field so they can enter the information
| | 00:41 | before they are allowed to
move on to the next record.
| | 00:44 | That's what we are going to do in this scenario.
| | 00:46 | Now you can see up to the top here, I am
using CustomerOrdersD from the Lesson 9
| | 00:50 | folder of the Exercise Files.
| | 00:52 | If you have been following along and
you have the Exercise Files you don't need
| | 00:56 | to open this one up.
| | 00:57 | You can continue to follow along.
| | 00:58 | If you are jumping to this lesson
however, go to your Lesson 9 folder and
| | 01:02 | open up this database.
| | 01:04 | The next thing you can do is actually
go to the Orders form, so we can all come
| | 01:08 | down here to the Navigation
Pane and click on the Orders form.
| | 01:12 | It's a very simple form, but we are going to
set up some validation rules using a macro now.
| | 01:18 | So let's say we want to make sure of
that, no matter what if the Product ID
| | 01:21 | field is left empty, they are not allowed to
save that record and move on to the next one.
| | 01:26 | Now you know when you are entering
data into a form, the information is
| | 01:30 | automatically updated when
you move on to the next record.
| | 01:33 | We want to stop that, if the
Product ID field is left empty.
| | 01:37 | Now, unlike the previous lesson, we
don't zero in on a particular field, we look
| | 01:41 | at the properties for this entire form.
| | 01:43 | So let's switch to Design View first
of all, click the View drop-down and
| | 01:47 | select Design View.
| | 01:49 | Next, we are not actually going to select
any of these fields in the Detail section.
| | 01:53 | We are just going to look at the Form
properties, so the Property Sheet must be
| | 01:57 | open and if it's not, you can give it a
click up here in the ribbon and next, we
| | 02:03 | are going to come down to this event.
| | 02:05 | So, you will have to click on the Event
tab and make sure that you are clicking
| | 02:08 | to the right of Before Update.
| | 02:14 | So, here is where we are going to set
up and event that will happen before this
| | 02:17 | record can be updated in this Form.
| | 02:20 | So, we can use the Builder for this we
will click on the ellipsis over here.
| | 02:24 | Select Macro Builder if necessary
and click OK, we have seen before in
| | 02:30 | the previous lesson.
| | 02:31 | The next thing we are going
to do is set up a condition.
| | 02:33 | So we need to view the Conditions
column by clicking Conditions up here and in
| | 02:38 | the Condition column here, let's put in
a condition that says if that Product ID
| | 02:43 | field is empty, to take some kind of
Action that would be to cancel the Event
| | 02:47 | and then we will have some further
actions to take place in this Macro.
| | 02:51 | Now, we can type that in
or we can use the Builder.
| | 02:54 | I am going to start off with the
Builder, give it a click and I am going to
| | 02:58 | go down to my Forms, double-click that,
double click Loaded Forms and click on Orders.
| | 03:06 | Here is where I see a list of all of
the content of this particular form
| | 03:10 | including Labels, Titles, but it's the
Product ID field that's important to me.
| | 03:17 | So I am going to click Product ID
and I am going to actually double-click
| | 03:20 | that with Value selected over here on
the right, to enter that up here in my
| | 03:25 | Expression Builder.
| | 03:27 | Next I am going to type in, Is Null,
so that means if the Product ID is left
| | 03:33 | empty something is going to happen.
| | 03:35 | So, when I click OK, you can see that's
actually entered for me, I could have type this in.
| | 03:39 | Now, I go over to the Action column
and what is the Action I want to happen.
| | 03:44 | I want to cancel the event, so
I am going to click CancelEvent.
| | 03:48 | Because remember the event we are
working on is Before Update and if I wanted to
| | 03:53 | I could put in Comments here just to
clarify what's happening in my Macro.
| | 03:57 | Now, I want more things to
happen so, I am going to click in the
| | 04:00 | Condition column underneath my first
condition and put in my three dots,
| | 04:04 | here is the ellipsis.
| | 04:05 | That means continue on.
| | 04:07 | After it's canceled then what?
| | 04:09 | How about a message pops-up?
| | 04:11 | So we will come in here
and scroll down to MsgBox.
| | 04:15 | There it is and some
information shows up down below.
| | 04:19 | We can enter our message.
| | 04:20 | This is what's going to show up for
the people who accidentally leave the
| | 04:23 | Product ID field empty.
| | 04:25 | I am going to type in 'You must enter a
Product ID.' Yes, there is going to be a Beep.
| | 04:34 | The Type down here, if we click next
to None and click the drop-down you will
| | 04:37 | see this could be no specific type of
message or it could be a Critical message,
| | 04:42 | a Warning it could be a Warning!
| | 04:44 | So we are going to see a different
icon depending on what we choose here.
| | 04:49 | We are going to provide this for the
person's information, so I am going to
| | 04:52 | select Information here and then if
we want information showing up in that
| | 04:56 | actual MsgBox in the Title bar we can
enter that here, Information Required,
| | 05:03 | how about, there we go.
| | 05:06 | So, there's our second actual Event
that's going to happen in this Macro and
| | 05:11 | then the third thing I would like to
add another one, three more dots and over
| | 05:14 | here on the Action column I would like
to take that person to the empty field so
| | 05:18 | that they are just right there
ready to enter whatever was missing.
| | 05:21 | So for us, that means going to an
actual control on the Form, so GoToControl,
| | 05:27 | down below we type in the name of Control.
| | 05:29 | Remember from previous lessons we need
square brackets, so here's my left square
| | 05:34 | bracket and Product ID is the
control or the field that we need to go to.
| | 05:41 | So, once we have entered
that we are ready to go.
| | 05:44 | So I am going to come up
here and I am going to hit Save.
| | 05:47 | I will save my changes.
| | 05:49 | I am going to close up my actual Macro.
| | 05:53 | Now this is an embedded macro.
| | 05:54 | It's built into the form.
| | 05:56 | You don't see it as an object
over here on our Navigation Pane.
| | 05:59 | All we have to do now is test it out.
| | 06:01 | So let's go back to the Form View, we
will come down here to New, I am going to
| | 06:05 | click right in here Customer ID, let's
say the same customer is going to place
| | 06:09 | another order, so Customer 8.
| | 06:11 | I am going to tab pass the
Product ID and test this out.
| | 06:15 | Let's say the Quantity is
going to be 1 and the price 349.
| | 06:20 | Now, watch what happens when I hit tab to
move to the next record. I hear the beep.
| | 06:25 | It says You must enter a Product ID.
| | 06:27 | There's my title Information Required.
| | 06:30 | When I click OK, look where my
cursor is flashing in the Product ID.
| | 06:34 | So, I type that in.
| | 06:36 | Now I can tab across and start a new record.
| | 06:39 | So, just another scenario where
Macros can be very useful in validating the
| | 06:44 | information that's going into your
form and eventually into the table.
| | 06:49 | Keep in mind that there's a number of
options that we can use when validating data.
| | 06:53 | You might want to practice this one on
the Customer ID field, maybe if that's
| | 06:58 | left blank, we should also have some
kind of warning and take the person back
| | 07:01 | and not allow them to update
this form without a Customer ID.
| | 07:05 | So, if you really want to practice this,
do the exact same thing we just did
| | 07:08 | with the Product ID field in the Form
properties, do it for Customer ID and you
| | 07:13 | will be an expert by the end.
| | Collapse this transcript |
| Creating auto-executing macros| 00:00 | Let's talk about one more kind of Macro
that automatically runs every time you
| | 00:04 | launch your database.
| | 00:06 | It's the AutoExec Macro.
| | 00:08 | And by having an AutoExec Macro in your
database, every time it's launched, you
| | 00:12 | can control what appears on the screen.
| | 00:15 | For example, if you have created a
Switchboard like we did a couple of
| | 00:18 | lessons ago, then you may want that
presented to the user every time they
| | 00:22 | launch the application.
| | 00:23 | The last work, we are going to do in
this lesson and before you can began, if
| | 00:27 | you have got Exercise Files, you'll
need to go to your Lesson9 folder and
| | 00:30 | open up MyApplication.
| | 00:31 | Now over here on the left you
can see we do have a Switchboard.
| | 00:35 | This is something, we created quite
a few lessons ago, if I click on the
| | 00:39 | Switchboard, you can see I have got a
few buttons here for adding new customers
| | 00:42 | products and orders.
| | 00:44 | I think it would be good if this main
menu that switchboard showed up every
| | 00:48 | time, we launch the application.
| | 00:50 | So that's what we are going to do, we
are going to create a Macro that does this.
| | 00:53 | First, we are going to go up to the
Create tab on the ribbon and I am going
| | 00:57 | to go all the way to the right and click on
Macro and this is going to be a very simple Macro.
| | 01:02 | We can put all kinds of controls into
what people are allowed to see and do into
| | 01:07 | an AutoExec Macro, but we will save
that for a more advanced title right now.
| | 01:11 | We are going to keep this simple.
| | 01:12 | We are going to present the
Switchboard every time, we launch this database.
| | 01:16 | So, the action from the drop-down here
is simply going to be to open a form.
| | 01:20 | So you scroll down to OpenForm,
down below in the Form Name field.
| | 01:26 | We'll click and from the
drop-down select our Switchboard.
| | 01:31 | That's all we need to do.
| | 01:32 | We don't need filter names or 'where'
conditions or Data Modes or Window Modes,
| | 01:36 | everything is perfect just the way it is.
| | 01:38 | What's very, very important though is
that we name this Macro correctly, so that
| | 01:43 | it does automatically execute
when we launch this database.
| | 01:47 | So, when we go up to the Save button.
| | 01:49 | It's very important that you call this AutoExec.
| | 01:53 | And I am using capitals for
the A and E. You don't need to.
| | 01:58 | It can be all lower-case. That's fine.
| | 02:00 | But it has to be AutoExec and when
you click OK, it now appears on the
| | 02:05 | Navigation Pane over on the left and
this will automatically execute now the
| | 02:10 | next time, we launch the application.
| | 02:12 | We are going to test it out.
| | 02:13 | So, first I am going to go up to this
tab right-click and close the Macro.
| | 02:17 | The other thing is I am going to
minimize this Navigation Pane because that's
| | 02:22 | the view I want people to see
when they come in. All right!
| | 02:24 | So, I am going to close this up, I am
going to go up to the very top and close
| | 02:29 | the entire database.
| | 02:31 | I have already got my Lesson9
folder open from the Exercise Files.
| | 02:34 | There is MyApplication, the one we just
saved up, so I am going to double-click it.
| | 02:40 | Watch what happens, boom!
| | 02:42 | I am taking straight to the main menu
and there is my buttons for adding new
| | 02:45 | customers products and orders.
| | 02:48 | So thanks to the AutoExec Macro, I've a
lot of control over what people see when
| | 02:53 | they come into this database.
| | Collapse this transcript |
|
|
10. Sharing Data with Word and ExcelImporting data into Access| 00:00 | So far in this title, we've spent a
great deal of time and energy investigating
| | 00:04 | different ways to design and
create objects in Microsoft Access.
| | 00:08 | We've looked at tables and
forms and queries and reports.
| | 00:12 | We've looked at different ways to get
data into your Access database as well.
| | 00:15 | We could either directly into a table
or use a form to make it easier and more
| | 00:20 | comfortable for entering data into a database.
| | 00:23 | But what if you have already got a
lot of the data existing elsewhere.
| | 00:26 | A typical scenario is people will use
spreadsheets to track information and
| | 00:30 | store data and then realize later
maybe they should be using a database
| | 00:34 | application like Access.
| | 00:36 | And now they have already got all of
that data sitting in an Excel spreadsheet
| | 00:39 | and they want to get it over into Access.
| | 00:42 | And we can do that quite easily actually.
| | 00:44 | That's exactly what we we're
going to do in this lesson.
| | 00:46 | If you look at the Title bar at the top
of my screen, you can see I am using a
| | 00:49 | database called CustomersA.
| | 00:51 | It's in the Lesson10
folder of your Exercise Files.
| | 00:54 | So you can go ahead and open that up.
| | 00:56 | Now we can be creating a brand new
database from scratch, and import data into a
| | 01:00 | table or like this scenario, we may
have already started our database and now
| | 01:05 | it's time to go get that information later on.
| | 01:08 | I have already got some tables, some
forms, I have even got, if you look down
| | 01:12 | here a Macro from a previous lesson.
| | 01:14 | So, now I want to bring in my
customer information. How do I do that?
| | 01:18 | Well, I am going to go to be actually
importing what's called External data.
| | 01:23 | So, from here, I am going to go up to
the External Data tab and you'll see I
| | 01:26 | have got options for importing.
| | 01:28 | I have got exporting.
| | 01:30 | I can collect data and I have got a
whole bunch of SharePoint Lists as well.
| | 01:34 | So, let's say I want to go get
information from an Excel spreadsheet.
| | 01:37 | It happens to be one of the choices
here in the Import section of my ribbon.
| | 01:41 | So I am going to click on Excel.
| | 01:46 | And I am going to
specify the source my data now.
| | 01:48 | So, I need to browse to that
actual data, that Excel spreadsheet.
| | 01:52 | I am going to go hit the Browse button.
| | 01:54 | And we'll navigate to the Exercise Files.
| | 01:58 | Again, it's Lesson10, so double-click
the Lesson10 folder and you can see I have
| | 02:02 | got a Customers spreadsheet here.
| | 02:04 | So, I am going to click on it and click Open.
| | 02:07 | That shows up now in the File Name field,
perfect, but I have got some options
| | 02:12 | down below to think about.
| | 02:13 | Do I want to import this data into
a brand new table in my database?
| | 02:18 | Well, that's what's selected by default
and it also happens to be what we want to do.
| | 02:23 | But other options could be to append
that information to an existing table.
| | 02:27 | So, if I already had a customers table
and I had all of the fields setup, the
| | 02:32 | same way they are set up in my Excel
spreadsheet, then I could simply add them
| | 02:36 | to the bottom of the table.
| | 02:38 | The other option is to link to the data
source by creating what's called a Linked Table.
| | 02:42 | And that's kind of handy because this
information gets updated in the Excel spreadsheet.
| | 02:46 | It gets updated in my Access
database but not the other way around.
| | 02:50 | So, the most common scenario is to
import source data that exists somewhere
| | 02:54 | else, our Excel spreadsheet into
a brand new table here in Access.
| | 02:59 | So with that selected, I am going to
click OK and now I am going to have a few
| | 03:03 | questions to answer.
| | 03:04 | You can see I am using the Import
spreadsheet Wizard, and if you look at the
| | 03:08 | data down below that's coming in, and
that's first row is actually Labels, isn't it?
| | 03:12 | Well, I have got a Checkbox up here.
| | 03:15 | The First Row Contains Column
Headings, if I check it, you can see what
| | 03:18 | happens, beautiful.
| | 03:20 | And everything else down
below would be an actual record.
| | 03:23 | All right, ready to move on to the next step.
| | 03:28 | Here is where we actually get to choose
options for the various fields that are
| | 03:32 | going to show up in our new table.
| | 03:34 | And you can see the first
one Customer ID is selected.
| | 03:37 | The Field Name is Customer ID, if
I want to change that name I could.
| | 03:41 | If I don't want, I can leave it.
| | 03:42 | The Data Type, I am going to change.
| | 03:44 | It doesn't need to be Double.
| | 03:46 | It's very short number, just a Customer ID.
| | 03:48 | I am going to go down to
Integer. Is it Indexed?
| | 03:52 | Well, you know what, this is going to
end up being our primary key, isn't it?
| | 03:55 | We don't want any duplicates here.
| | 03:57 | That means Yes, it's indexed
and duplicates are not okay.
| | 04:01 | So, I am going to click this drop-
down and choose Yes, with no duplicates.
| | 04:06 | And you can see I also have an option to not
even Import this field, but I do want to import.
| | 04:11 | And if there are other fields I want
to work with, I could as well just by
| | 04:14 | clicking them, for example, if I go
over to State, you can see it is a
| | 04:20 | Text Field, perfect.
| | 04:21 | That's what I want. It's not Indexed.
| | 04:23 | Everything seems to be okay.
| | 04:25 | The Zip Field, even though it's all
numbers, it should be a Text Field and it is.
| | 04:29 | So, our Access is pretty smart in
figuring out what your field should be.
| | 04:33 | I am going to click Next.
| | 04:36 | Now look what's happening.
| | 04:37 | Access is wondering if it should add a
column in here, a new field called ID
| | 04:41 | to be the primary key.
| | 04:43 | And if we let Access add the
primary key that's what would happen.
| | 04:46 | But we already know our Customer
ID is going to be our primary key.
| | 04:50 | So I am going to say instead of no
primary key, Choose my own primary key.
| | 04:55 | And by default the Customer ID gets
slotted in as the primary key and that's
| | 05:00 | perfect that's just what
we want. So we click Next.
| | 05:03 | Now it just time to give it a name,
Customers is going to be fine for me.
| | 05:08 | If I want I can have the Wizard analyze
my table after importing the data, but I
| | 05:12 | am pretty confident.
| | 05:13 | It's going to be okay.
| | 05:14 | So, I am going to click Finish.
| | 05:16 | And this is kind of neat.
| | 05:18 | I can save those import steps.
| | 05:20 | That means if I need to do this
again at a later date, I won't need to go
| | 05:23 | through all those selections and those
various steps by saving the import steps,
| | 05:28 | I just run the Import next time and
I would save my import using a name.
| | 05:32 | I can put in a Description, even create
an Outlook task, if I wanted to do that.
| | 05:36 | But I am not going to save the
imports, so I am going to deselect that.
| | 05:40 | And just choose Close.
| | 05:43 | So, right away, look what happened.
| | 05:45 | I've now got a new Customers : Table
and if I click on Customers : Table, it
| | 05:49 | shows up with my Customer ID that's my
primary key and then each of the field
| | 05:54 | shows up just as they were entered
into that in Microsoft Excel spreadsheet.
| | 05:59 | So, if you've already got data
existing in an Excel spreadsheet and you are
| | 06:03 | converting over to a database, I don't
think you have to retype or re enter that
| | 06:08 | data, if you have already got it,
just import it into Microsoft Access.
| | Collapse this transcript |
| Using Package and Sign| 00:00 | Sharing a Microsoft Access Database is a
little bit different than sharing, say,
| | 00:04 | a simple Word Document or
PowerPoint Presentation.
| | 00:08 | We now know that a Microsoft Access
database can contain many objects like
| | 00:12 | Tables and Forms, Reports and more
importantly little programs called Macros.
| | 00:19 | They can be objects or they can be hidden
inside other objects like Forms, for example.
| | 00:23 | You can even add VBA coding to a
Microsoft Access database and for that reason,
| | 00:28 | Access databases can be considered
dangerous as soon as you get Macros and VBA
| | 00:33 | coding built into a database, well,
people can use that for a malicious reasons.
| | 00:38 | So we are going to look at a feature
that allows us to package up our database
| | 00:41 | and sign it digitally before we
share to increase trust levels.
| | 00:45 | You want to make sure if you are
receiving a database from someone else that you
| | 00:49 | can trust the source and the content
of that database and that's what we are
| | 00:52 | going to do in this lesson.
| | 00:54 | So if you've got exercise_files,
go to the lesson_10 folder of those
| | 00:57 | exercise files and open up CustomersB
and we are ready to start the Package
| | 01:02 | and Sign routine but before we do,
we have to have at least one digital
| | 01:07 | signature to apply.
| | 01:09 | So I am going to show you how to do that
now in case you have never done it before.
| | 01:12 | We are going to go down to the Start
button, and in the Start Search field down
| | 01:16 | here in Windows Vista, I am just going
to type in Digital and you can see right
| | 01:21 | at the top under Programs, I get
Digital Certificate for VBA Projects.
| | 01:25 | You can navigate to that by going
through All Programs, going to Microsoft
| | 01:29 | Office, and then there is a Microsoft
Office Tools folder where you'll find this
| | 01:34 | but this is a lot faster.
| | 01:35 | So I click on Digital Certificate for
VBA Projects and here is where I can
| | 01:39 | create my own digital certificate.
| | 01:42 | Now keep in mind it's a self-signed
digital certificate that will bear my name
| | 01:47 | and since it's a self-signed digital
certificate, it could be forgery somebody
| | 01:52 | could be in here creating a
certificate with my name on it, obviously.
| | 01:56 | So it's not the most secure
version of a digital certificate.
| | 01:59 | Now you can get a commercial
certificate through commercial certificate
| | 02:04 | authorities and there is a
link here to get a list of those.
| | 02:07 | Of course, you've got to pay money
for those but they are a little bit more
| | 02:10 | trustworthy, so if you wanted to go that
route you could but for this particular
| | 02:15 | lesson we are going to create our own
self-signed digital certificate and we are
| | 02:18 | going to add the name down here
where it says Your certificate's name.
| | 02:21 | So I am going to type in David Rivers,
I am going to put in a dash here and
| | 02:28 | put in - Databases. And click OK.
| | 02:31 | So I have successfully created a
new certificate for David Rivers -
| | 02:38 | Databases and I click OK.
| | 02:39 | That means now when I go through the
Package and Sign routine, I will be able to
| | 02:44 | choose that certificate.
| | 02:45 | You'll find that under the Office
button, so click the Office button.
| | 02:50 | We come down to Publish and that's
where we find Package and Sign, so give it a
| | 02:55 | click and you can see I have got my
certificate right here, Issued To, I am
| | 02:59 | going to spread out these column so
you can read David Rivers - Databases.
| | 03:03 | Issued By should be the same thing, yup.
| | 03:06 | And Intended Purposes, Code Signing,
there was no no Friendly Name applied
| | 03:10 | to it and you can see an Expiration date.
| | 03:12 | All that was setup by default for me, so
I am going to click on OK and now I get
| | 03:19 | to choose the name for my Package database.
| | 03:22 | Keep in mind that this is going to be
an Access sign or package, so it's not
| | 03:26 | going to be just the database.
| | 03:27 | People will have to extract the database
from this package when they receive it.
| | 03:32 | So the file name CustomersB is fine
but I am going to put it on my desktop.
| | 03:36 | So I am going to click Desktop, leave it
called CustomersB and that's just based
| | 03:41 | on the name of the actual
database itself and click Create.
| | 03:45 | It takes some moment and it's done.
| | 03:47 | Now I am still in my database here in
Microsoft Access working way but if I
| | 03:52 | minimize this and go back to my Desktop,
you'll see that I have actually got one
| | 03:57 | called CustomersB here.
| | 03:59 | There is the Access symbol but
it's also got this certificate.
| | 04:02 | So when I double-click this, see what
happens Microsoft Office Access Security
| | 04:08 | Notice shows up, indicating there is a
potential security concern and that is
| | 04:13 | the digital signature is valid, but the
signature from a publisher whom you have
| | 04:18 | not yet chosen to trust
is what's showing up here.
| | 04:21 | In other words, I haven't actually added
that signature to my list of trusted sites.
| | 04:26 | So you can see the file
path here where it's located.
| | 04:30 | The option I have is to Trust All.
| | 04:33 | That means everything I receive from
this publisher or I can open it up.
| | 04:36 | Now I am going to click Trust All
from Publisher, which now shows on Window
| | 04:41 | where I can extract the database to.
| | 04:43 | Now I am going to extract
it right to the desktop.
| | 04:46 | I am going to click OK and I am going
to minimize Microsoft Access just to show
| | 04:56 | you that it's there but it did open up.
| | 04:59 | You can see I have got two.
| | 04:59 | I have got the one that I am working on.
| | 05:01 | It's locked and CustomersB right here.
| | 05:04 | It's as easy as that, I am going to
foot back to the one I just extracted from
| | 05:08 | that package using the Package and Sign feature.
| | 05:11 | It's quite simple, keep in mind if you
are going to use it you need to have a
| | 05:15 | digital signature whether it's self
-signed or you have got one from a
| | 05:18 | commercial organization.
| | 05:20 | Either way you need to have one of
those signatures to apply to the package
| | 05:23 | before it can be
compressed and ready to be sent off.
| | Collapse this transcript |
| Sharing via email| 00:00 | In this lesson, we're going to look at
yet another way to share Microsoft Access
| | 00:04 | data with others and that's via e-mail.
| | 00:07 | Now in Access 2007, we can choose to
share a part of our database such as a
| | 00:12 | report or a form, for example or we can
share the entire database and I'm going
| | 00:17 | to show you both ways.
| | 00:18 | Let's start with sharing a
single object from our database.
| | 00:22 | Of course, if you're following along in
previous lessons, then you can just use
| | 00:26 | the existing database you
may have open right now.
| | 00:29 | If you're jumping to this lesson and you
have Exercise Files, go to the Lesson10
| | 00:33 | folder, and open up CustomersC.
| | 00:34 | That will get you all caught-up.
| | 00:37 | Next, we're going to select the
actual object we want to share.
| | 00:41 | A typical scenario is to share
a report with others via e-mail.
| | 00:45 | So, I'm going to click on
the Order Totals report.
| | 00:47 | That opens it up over here where I can see it.
| | 00:50 | This is exactly what I want to send off
to either one or more people via e-mail.
| | 00:55 | To do that, it's very simple.
| | 00:57 | I just go up to the office
button and select E-mail.
| | 01:01 | Next, the Send Object As dialog box
shows up and I get to choose the format I
| | 01:05 | want to save this report in, before it
gets attached to the e-mail and gets sent off.
| | 01:10 | If I want folks to open up my report
in a web browser, I would choose HTML.
| | 01:15 | If I'd like people to be able to open
it up in their default Word Processor
| | 01:19 | like Microsoft Word for example, Rich Text
Format or even Text File Format would be good.
| | 01:23 | If I want people to see a snapshot of
my report, so, not an actual report, but
| | 01:29 | almost like a picture of my report, I
can choose this format called Snapshot.
| | 01:33 | I'm going to leave it at Rich Text Format.
| | 01:36 | That way folks who have Microsoft Word
or any other Word Processor will be able
| | 01:40 | to open it up and I'm going to click OK.
| | 01:43 | Right away Access jumps into action
launching my default e-mail application,
| | 01:47 | which is Microsoft Outlook, and you
can see that the file is actually already
| | 01:51 | attached and converted to RTF.
| | 01:54 | So, it's sitting there waiting for
me to send it off to whoever I want.
| | 01:57 | So, I'm going to type in an address here,
I'm going to type in my own address.
| | 02:02 | I could add as many people here at
Distribution List, but I'm going to send
| | 02:05 | this to one person.
| | 02:07 | The Subject, which is optional, is going
to be Latest numbers on Orders and down
| | 02:16 | below, if I wanted to include a message I could.
| | 02:18 | Just click down here, I'm just going to
type in See attached report, just like that.
| | 02:25 | I'll hit the Send button and off goes this
report to that e-mail recipient, easy as that.
| | 02:31 | Now, what if I wanted to send this entire
database, so, all of these objects in a database?
| | 02:37 | Well, in the previous lesson you
may recall, we talked about the
| | 02:40 | Package-and-Sign feature, and that
allowed us to package all of the objects in
| | 02:44 | our database into one file.
| | 02:46 | It would compress it, so that it
would be easy to e-mail or download.
| | 02:50 | We could even add a digital
signature to create some authenticity.
| | 02:54 | While that's what we're going to do now,
but not from Access, we're going to go
| | 02:57 | down to our Start button and
launch our default e-mail application.
| | 03:02 | Mine is Outlook, so I'm going to select
it and I'm going to create a new message.
| | 03:07 | In here, I'm going to add an attachment,
so I'm going to come up here, not this
| | 03:11 | one here, attaching an item would be
attaching another e-mail message, but this
| | 03:14 | one right up here, the paper-clip, when
I click Attach File, I just need to go
| | 03:18 | browsing now to my Exercise Files.
| | 03:21 | So, go ahead to the Lesson10 of the
Exercise Files and find CustomersPkg.
| | 03:28 | You'll notice that this little
icon looks different from the others.
| | 03:31 | It's got that certificate.
| | 03:33 | So, this is what we use,
the Package-and-Sign feature.
| | 03:36 | So, I'm going to double-click it or
one click and Insert attaches it down
| | 03:41 | here in my message.
| | 03:42 | Now, all I have to do is type in who I'm
sending it to, send it to the same person.
| | 03:48 | Again, a subject and when I hit Send,
the entire database is sent off in a
| | 04:02 | package to the recipient.
| | 04:03 | I'm going to close Microsoft Outlook.
| | 04:05 | It takes me back to Access where
I'm looking at my Order Totals Report.
| | 04:10 | So, there you have a couple of different
ways via e-mail to share your data with others.
| | 04:16 | It can be a single object, by
selecting it from the Navigation Pane here in
| | 04:20 | Access or it can be your entire
database, if you use that Package-and-Sign
| | 04:24 | feature we've talked
about in the previous lesson.
| | Collapse this transcript |
| Exporting data to Excel| 00:00 | A few lessons ago, we learned how
easy it was to import data from Microsoft
| | 00:05 | Excel into Microsoft Access and
create a brand new table out of that.
| | 00:09 | Well, the reverse is equally as easy.
| | 00:12 | We can take data that exists in
Microsoft Access, like a table or query results
| | 00:16 | for example, and export that to
other formats, including Microsoft Excel.
| | 00:21 | So, let's take a look at the
Export feature in Microsoft Access now.
| | 00:25 | If you are jumping to this lesson and
you want to follow along, you've got
| | 00:28 | the exercise files, go to the Lesson
10 folder of those exercise files and
| | 00:32 | open up CustomersC.
| | 00:34 | We were using that in the previous
lesson, so if you are following along, you
| | 00:37 | are good where you are.
| | 00:39 | Next, we are going to go up to the
External Data tab and here is where we
| | 00:44 | see the Export section.
| | 00:46 | Now, you'll notice right now that Excel
and SharePoint List, they are grayed out.
| | 00:51 | Why is that?
| | 00:52 | Well, right now I am looking at a
report, so I couldn't export a report to
| | 00:55 | Excel, but I could to a Word document,
we did that in the previous lesson using
| | 01:00 | our Email function or a Text File.
| | 01:02 | There are some other formats.
| | 01:04 | If we click the More drop-down, you
can see we either could export this to an
| | 01:07 | Access Database, an XML File.
| | 01:09 | There is that Snapshot
format, even an HTML Document.
| | 01:13 | Well, let's go over here now and
click on the Customers: Table.
| | 01:16 | As soon as I do that, look what happens up here,
the Excel and SharePoint list is available.
| | 01:22 | If I click the More drop-down, I have
got many more options to choose from as
| | 01:26 | well, like dBASE, Paradox, Lotus.
| | 01:29 | I can even take this table and merge
it with Microsoft Office Word and use
| | 01:33 | this in a Mail Merge. So that's awesome.
| | 01:36 | But we are going to export this to
Microsoft Excel, so all we need to do is
| | 01:40 | click this button right here in
the Export section on the Ribbon.
| | 01:44 | Now, we have some options to choose
from, like the name of our file and its
| | 01:48 | location and you can see by default,
it's going to be called Customers.xlsx.
| | 01:52 | That's because we are
using the Office Suite 2007.
| | 01:57 | That's why that format is showing up, and
the name is showing up based on the table
| | 02:01 | that's selected called Customers.
| | 02:03 | I am going to change the name slightly.
| | 02:04 | I am going to call it CustomersSheet
and I am going to change the format to a
| | 02:08 | previous version of Excel, in case
the people I may want to share this with
| | 02:12 | don't have the latest version.
| | 02:14 | So I am going to click this drop-down,
change the format to Excel 97 - Excel
| | 02:18 | 2003 just like that.
| | 02:21 | Now if I wanted to, I could change the location.
| | 02:23 | Right now, it's going to my Desktop but
I could use the Browse button to choose
| | 02:27 | another location, if I wanted to.
| | 02:29 | I am happy with that location.
| | 02:30 | Yours is probably going to
be your Documents folder.
| | 02:33 | It could be another folder depending on,
if you have used this feature before
| | 02:37 | and what your selection was
the last time you used it.
| | 02:39 | Next, we get to specify some options.
| | 02:42 | Now down below you will see that
only one option is available currently.
| | 02:46 | If I was to export this data with the
formatting and the layout, then I would
| | 02:50 | also have the option down below to
open the destination file after the export
| | 02:55 | operation is complete.
| | 02:56 | So, I am going to click that, as well as,
Open the destination file when it's done.
| | 03:01 | The only thing that's not available to
me right now is Export only the selected
| | 03:05 | records option and the reason is I
didn't select records in my table.
| | 03:09 | That means the entire
table is going to be exported.
| | 03:12 | If I wanted to select just certain
records in that table, I could do that by
| | 03:16 | highlighting those records and then
this option would be available to me.
| | 03:21 | I am going to click OK, keep in mind
that it's going to launch Microsoft Excel
| | 03:25 | automatically when it's done.
| | 03:27 | So, I will click OK.
| | 03:27 | It doesn't take long, here comes Microsoft
Excel and you can see the results in here.
| | 03:33 | If I maximize this screen, you can see
that it looks very much like my table
| | 03:38 | in Microsoft Access.
| | 03:40 | Now, I could use some of the Excel
Tools for analyzing and manipulating this
| | 03:43 | data if I'd wanted to.
| | 03:44 | Now you may have noticed down in my
Task bar that Microsoft Access is flashing
| | 03:48 | and that's because the
wizard isn't quite complete.
| | 03:51 | When I click on Microsoft Access,
there is one last step here and that is the
| | 03:54 | option to save the export
steps that I just went through.
| | 03:58 | That's handy if I do this on a regular
basis, because then I can just go back to
| | 04:02 | a Saved Export and just run it each
time that I want, as I get new data updated
| | 04:07 | into my table and so on.
| | 04:08 | I am not going to do that.
| | 04:10 | I am going to click Close.
| | 04:12 | But I want you to see that Saved Exports
then show up under the Saved Exports button.
| | 04:17 | So, pretty simple stuff.
| | 04:19 | I can export my data into many, many
different formats including Microsoft Excel
| | 04:24 | and again, the typical scenario is
there are analytical Tools built into Excel
| | 04:28 | that you may not have
access to in Microsoft Access.
| | 04:32 | So exporting your data to
Excel is a very handy feature.
| | Collapse this transcript |
|
|
11. Working with ChartsWorking with charts| 00:00 | Sometimes when you are working with
data in Microsoft Access or any other
| | 00:04 | application for that matter, it can be
useful to get a graphical representation
| | 00:08 | of the data you are looking at.
| | 00:11 | For example, a common scenario in a
report where you have got numbers and text
| | 00:15 | thrown out on the page, it might be
helpful to have a graph in there or some
| | 00:19 | kind of chart showing you the big
picture, making it a little bit easier to
| | 00:23 | understand what you are looking at.
| | 00:24 | Well, that's what we are going to do
in Microsoft Access in this lesson.
| | 00:27 | We are going to add a
chart to one of our reports.
| | 00:30 | So if you have got exercise_files,
go to the Lesson_11 folder of your
| | 00:34 | exercise_files and open up ChartA.
| | 00:36 | And once you have opened up this database,
we can go over to the Order Totals report.
| | 00:41 | Now this should look familiar if
you have been following along through
| | 00:44 | the previous lessons.
| | 00:45 | I have added a column for the Product
ID since that's something we might want
| | 00:49 | to use in our chart.
| | 00:50 | All right, the next thing we are
going to do to add the chart maybe to the
| | 00:53 | bottom, or to the side of this
report, would be to go to Design View.
| | 00:57 | So we go up to our View drop-
down and switch to Design View.
| | 01:01 | And now from here, we are going
to select where the chart goes.
| | 01:04 | Now if we put it at the bottom, we
probably want to put it in the Report footer.
| | 01:08 | If we put it over to the side, we would
also do that in the Report footer section.
| | 01:13 | Otherwise, we end up with chart
showing up next to every single record and
| | 01:17 | that's not what we want.
| | 01:18 | We want a grand total, the big picture.
| | 01:21 | So we are going to add it
to the Report footer section.
| | 01:24 | And I am going to put mine at the bottom.
| | 01:25 | Now it doesn't look like there is
enough room there but we will make room.
| | 01:29 | All we do now is go up to the Control
section here on the ribbon, find this
| | 01:33 | little icon that looks like a bar
graph and click the Insert Chart button.
| | 01:38 | Now we are going to come down here,
and just click-and-drag the shape and the
| | 01:41 | size of the chart that we want.
| | 01:43 | I am going to go like so, a rectangular shape.
| | 01:45 | Now as soon as I do the Chart Wizard
starts up because I have got this Wizard
| | 01:49 | button selected over here, and it's
asking me which table or query would I like
| | 01:53 | to use to create this chart.
| | 01:55 | Well, we are looking at Orders, so I
am going to use the table called Orders.
| | 01:59 | Now if we had queries in there, we
could select them too or select from both.
| | 02:03 | I am going to use the Orders:
| | 02:05 | Table, click Next which field
contains the data that we want for the chart.
| | 02:09 | So we are looking at the number
of orders for various products.
| | 02:12 | So what I would like to see are the
products being ordered, the percentage of
| | 02:16 | which products are getting
ordered and the quantity.
| | 02:19 | So I am going to choose a Product ID,
and that's why I added that Product ID
| | 02:24 | column and the Quantity.
| | 02:27 | And I am going to click Next.
| | 02:29 | This type of data that I have just
selected would be ideal for a pie chart but
| | 02:33 | you can see I have got all kinds of
different charts and graphs to choose from.
| | 02:37 | Right now, Column Chart, the very first
one up here is selected, but I could go
| | 02:40 | to a 3D Column Chart.
| | 02:42 | And you can see there is
variations of the column.
| | 02:46 | Same thing going vertically and horizontally,
and then we get into some area ones as well.
| | 02:51 | But like I said, ideally the pie chart would
work well for what we are doing in this lesson.
| | 02:57 | So I am going to select
this Pie Chart and click Next.
| | 03:00 | Automatically, it's taken the two
fields I have selected, Product ID and
| | 03:04 | Quantity and kind of slotted them into
the legend and the data areas of my chart.
| | 03:10 | I can preview my chart at any time.
| | 03:12 | I am going to click Next.
| | 03:14 | And the next option is if we want the
chart to change from record to record, we
| | 03:18 | can select fields that link the
document and the chart together.
| | 03:21 | I don't want that happening, I just want
the big scheme to be shown at all times.
| | 03:25 | So I am going to choose no field for
both the Report and the Chart fields.
| | 03:30 | When I click Next, I now have an
option to name my chart, Total Orders.
| | 03:37 | And yes, I would like to display a legend.
| | 03:39 | The legend is going to be
based on the Product ID.
| | 03:42 | So when I click Finish, you are going to
see a representation of that down below.
| | 03:46 | I am going to stretch this down a
little bit, Report Footer to create some
| | 03:50 | space below it as well.
| | 03:52 | And this is definitely not the
actual data that's showing up.
| | 03:55 | To see the results, I
need to go to my Report View.
| | 03:58 | And I am going to do that now.
| | 03:59 | All right, as we scroll down, you can
see according to the size I selected,
| | 04:07 | we have got our Total Orders chart showing up.
| | 04:10 | It's giving me a representation of
the various Product IDs 1, 2, 3, and 9.
| | 04:15 | That's all I have in this particular report.
| | 04:18 | Product IDs 1, 2, 3, and 9, and you can
see the relationship one to the other.
| | 04:23 | Now if I want to add some pizzazz to
this chart, I can do that too and I can
| | 04:27 | edit the chart itself.
| | 04:28 | But again, I need to go back to Design View.
| | 04:30 | I am going to switch to Design View
here, and I am going to right-click right
| | 04:36 | in the white space here in my chart
and you can see I get a whole bunch of
| | 04:40 | options showing up.
| | 04:41 | So I can choose from the Properties
that are currently showing up over here.
| | 04:45 | If they are not, clicking
Properties does show them.
| | 04:47 | I have got Special Effects.
| | 04:49 | I have got Fills, the Layout, Position,
Size, Alignment, all kinds of options.
| | 04:55 | The Chart Object up at the top here, if I
need to edit it, I can come over to Edit.
| | 05:01 | And now I am into a new design mode
where I am editing the actual chart itself.
| | 05:05 | So now when I right-click, you can
see I can format the chart area and I
| | 05:11 | am going to do that.
| | 05:11 | I have got Patterns and Fonts.
| | 05:14 | Right now under Border,
you can see None is selected.
| | 05:18 | But I am going to do an automatic one, and
the color, I am going to use a nice Dark Blue.
| | 05:23 | The area currently has
nothing in behind as well.
| | 05:26 | I could choose a nice
light color if I wanted to.
| | 05:29 | So I am going to go over
here to a very light blue.
| | 05:33 | And I am going to click OK.
| | 05:34 | We will leave the Font as it is.
| | 05:36 | You can see it's looking nicer already.
| | 05:38 | All right, next, I am going to right-click
again and notice I can change the
| | 05:43 | Chart Type as well as the Chart Options.
| | 05:45 | Now in the Chart Options, I have got Titles,
Total Orders is what shows up there now.
| | 05:51 | And if I wanted to I could change that.
| | 05:53 | The Legend, I can choose to show it or not.
| | 05:56 | And you can see its showing up on the right.
| | 05:58 | Now Data Labels is where I
can start adding some info here.
| | 06:02 | For example, if I wanted the
percentages showing up, that could be helpful and
| | 06:06 | you can see it doesn't take
any more area than needed.
| | 06:09 | It shrinks down the pie and uses
that extra space to throw in the
| | 06:12 | percentages around the outside.
| | 06:14 | I have got a Legend Key down
here if I wanted to as well.
| | 06:17 | So I chose the color.
| | 06:18 | I have already got the color next to
the pie, so I am going to deselect that.
| | 06:22 | When I click OK, I am going to see
those changes in my actual chart.
| | 06:26 | Now I am going to click on the pie
itself, and I am going to pull out this
| | 06:29 | piece, kind of neat.
| | 06:31 | I can separate the largest piece if I wanted to.
| | 06:35 | And now, to go back to the Design
View for the actual report, I just click
| | 06:40 | outside the chart area and now to go
see what it looks like, I can click on the
| | 06:44 | Report View and just scroll down.
| | 06:47 | So you can see now I have got my color,
I have got my border, I have got my
| | 06:50 | values, my pie pieces are separated, and
they have got percentages around the outside.
| | 06:55 | Using the Legend, I can see which
of my products are selling the best.
| | 07:00 | So that's just one way to add a
chart or a graph to an existing report.
| | 07:05 | You can do the same for forms
as you can here for reports.
| | 07:09 | In the next lesson, we will look
at another type of chart called the
| | 07:12 | pivot chart.
| | Collapse this transcript |
| Working with pivot charts| 00:00 | We're going to look at another kind
of chart here in Microsoft Access 2007
| | 00:04 | called the PivotChart.
| | 00:06 | Now the PivotChart is not really a chart.
| | 00:08 | It's actually a form, but it looks a
lot like a chart, when you manipulate the
| | 00:12 | data that you pull from somewhere else.
| | 00:14 | That can be from a table, or from a form.
| | 00:17 | In this lesson, we're going to use the
Customers form to create a PivotChart
| | 00:20 | that gives us an idea of
where our customers are located.
| | 00:24 | So we can filter down by state and
view by categories or cities for example.
| | 00:29 | So first thing you need to do is, if
you've got Exercise Files, go to the
| | 00:33 | Lesson 11 folder and open up ChartB
and once you've got it, we'll come over
| | 00:38 | here to our Navigation Pane and click on the
Customers form to display it over here on the right.
| | 00:43 | So we've got a number of customers
here, looks like we've got 11 of them.
| | 00:47 | And each of them has their own information.
| | 00:50 | We may have multiple customers in
several of the states and even in some of
| | 00:55 | those cities within the state.
| | 00:56 | So a PivotChart will allow
us to look at the big picture.
| | 00:59 | So the very first thing that we need
to do is go up to the Create tab in the
| | 01:03 | ribbon here and choose PivotChart.
| | 01:05 | Now right away, watch what happens,
we get a new tab called Customers1.
| | 01:10 | So it takes the Customers form that
was already open, creates a duplicate
| | 01:14 | Customers and adds 1 at the end,
because it can't have the same name.
| | 01:16 | You will notice here we've got our Data area.
| | 01:19 | We've got an Axis Title on the left and
the right that can be filled in and we
| | 01:24 | can do a little bit more with this
chart after we've got our data in there.
| | 01:28 | But you'll notice that we've also got
these little drop zones, where we can drop
| | 01:31 | fields in from our Customers form.
| | 01:34 | Now if you don't see the Field list,
you may need to click this Field List
| | 01:38 | button over here in the Show/Hide
section of the ribbon.
| | 01:41 | And then I'd like to move this into an
area where it's not overlapping any of my
| | 01:45 | drop zones, so I can easily drag and
drop fields from this list, and this list
| | 01:50 | of fields comes right from the
Customers form and I can drop them into these
| | 01:54 | drop zones to see the results.
| | 01:56 | For example, if I want to see an
overhead view of all of my customers by state,
| | 02:00 | I want to be able to filter by state.
| | 02:02 | Notice up here it says Drop Filter Fields Here.
| | 02:05 | So if I want to filter by state, I can
drag and drop that one right in here.
| | 02:09 | Once it's highlighted, and I let go,
I am now able to filter by State.
| | 02:14 | By default All states will be showing,
unless I click this drop-down and
| | 02:18 | select a specific state.
| | 02:21 | Save that for after.
| | 02:22 | Now with the Data fields all what's
going to happen is whatever field we drag in
| | 02:26 | here, it's going to be counted.
| | 02:27 | So we want to count the number of
customers in a specific state or city.
| | 02:32 | We're going to choose one of
these, like First Name or Last Name.
| | 02:34 | I am going to choose the Last
Name field and just drop it in there.
| | 02:37 | You will see it actually
says Count of Last Name.
| | 02:40 | It looks like altogether I've got 11 customers.
| | 02:43 | But it's not broken down here into series
yet, and that's where the city comes in.
| | 02:48 | If we want to split this up by city now,
we can drag the City field over here
| | 02:52 | into the Drop Series Fields
Here, drop zone and let go.
| | 02:57 | And you can see that data looks a
whole lot different in the background.
| | 03:01 | If I hover over any of these bars I am
going to get some information in this
| | 03:04 | series, which is the city of Manotick.
| | 03:06 | You can see I've got four.
| | 03:09 | Over here I've got two and this one
called Vanier and this is for all of my states.
| | 03:14 | If I want to narrow it down to a
specific state, I can do that by deselecting
| | 03:18 | all and selecting the one
state that I want, like PA.
| | 03:21 | I am going to click OK.
| | 03:23 | Notice how my data changes.
| | 03:26 | So for the state of PA, I've got-- it
looks like one in Barrhaven and over here
| | 03:31 | I've got four in the city of Manotick.
| | 03:32 | I am going to switch that back now to
CA and PA, so I can look at two different
| | 03:39 | states and get a good feel for how my
customers are scattered about the states
| | 03:44 | and the various cities in those states.
| | 03:46 | That's what a PivotChart is all about.
| | 03:48 | Being able to manipulate the data
to get the view we are looking for.
| | 03:52 | I am going to close up this Chart Field List.
| | 03:55 | I am going to switch this back to All, click OK.
| | 04:00 | And for City if I wanted to just narrow it
down to specific cities I could do that too.
| | 04:05 | But I am going to leave it selected as All.
| | 04:07 | And if we had categories, we could also
use this drop zone down below and so far
| | 04:13 | we've created what's called the
PivotChart with some options selected.
| | 04:17 | We've tested out but we
haven't saved anything yet.
| | 04:20 | If I was to close this up by right
clicking, I would be prompted to save it.
| | 04:24 | So let's go up and save this now.
| | 04:26 | We'll give it a different
name other than Customers1.
| | 04:29 | It's already highlighted.
| | 04:30 | So I am going to call this
particular one, Customers by State.
| | 04:35 | Now if I wanted to I can put in brackets
Pivot, just to remind me that this is a
| | 04:40 | PivotChart and I'll click OK.
| | 04:43 | So it shows up over here
along with my Customers Form.
| | 04:48 | So at any time if I want to look at it,
I can come over here, see the latest,
| | 04:53 | filter down if I wanted to and manipulate my
data to show me exactly what it is I need to see.
| | 05:01 | So play around with PivotCharts,
experiment, see what happens when you move
| | 05:06 | fields from one drop zone to another.
| | 05:08 | Add extra fields and so on.
| | 05:10 | There is a lot of fun you can have
with PivotCharts and it really does give
| | 05:14 | you a lot of flexibility in displaying
the data you want to display, the way
| | 05:18 | you want to display it.
| | Collapse this transcript |
|
|