navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Access 2010: Forms and Reports in Depth

Access 2010: Forms and Reports in Depth

with Adam Wilbert

 


Discover how to manage data entry and reporting tasks more efficiently using Access 2010. Author Adam Wilbert presents lessons on designing forms, organizing and displaying data with form controls, creating flexible queries, and building a form-based navigation system. The course also shows how to build reports from wizards and queries, highlight important data with conditional formatting, and automate reporting processes with macros.
Topics include:
  • Designing for the end user
  • Organizing form elements
  • Formatting a form
  • Adding headers
  • Linking to external content
  • Entering and selecting data
  • Adding charts
  • Creating a main menu
  • Creating a customer form
  • Understanding report structure
  • Building reports from wizards and queries
  • Printing reports

show more

author
Adam Wilbert
subject
Business, Forms, Databases
software
Access 2010, Office 2010
level
Intermediate
duration
3h 7m
released
Feb 14, 2012

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Hello! I'm Adam Wilbert and I'd like to welcome you to Access 2010 Forms and Reports in Depth.
00:09In this course, we're going to explore the inner workings of two highly
00:12configurable objects inside an Access database.
00:15With forms, I'll show you how to create easy-to-use data entry points that
00:19interface with your data tables.
00:20We'll work with controls and layout and design views as well as explore
00:24Access's extensive property sheets where we can fine-tune their behavior,
00:28appearance, and interactivity.
00:30Reports use many of the same tools and techniques as forms and they're great for
00:34preparing data for the printed page.
00:36With reports we'll look at grouping data into categories while leveraging
00:40header and footer sections to organize your report structure and make them easy to read.
00:44We'll build reports from scratch that are tied to query record sources for
00:47increased flexibility and we'll hook them all back into a form-based navigation
00:51system to help end-users move around your database and accomplish tasks without
00:55having to note anything about its inner structure.
00:57So, thank you for joining me.
00:59Now let's dig into Access 2010 Forms and Reports in Depth.
Collapse this transcript
Using the exercise files
00:00If you have access to the Exercise Files for this course, you can put them on
00:03your Desktop, as I've done here, or anywhere else you want.
00:07I'll double-click on this Exercise folder and you'll see that I've organized the
00:10exercises into folders for Chapter.
00:13Within each folder are the files for each movie.
00:16For some movies, I've included a completed version for you to review.
00:20Now, if you don't have access to the Exercise Files you can follow along
00:23with your own databases.
Collapse this transcript
1. Introduction to Forms
Introducing forms
00:00One of the things that I really like about Access is that it's not just a
00:03place to store data.
00:04Yes, we talk a lot about data and records and relationships and queries, where
00:08Access truly shines is in your ability to create a fully customized application
00:13that is uniquely tailored to your specific needs.
00:15Where this really becomes apparent is when we start digging into forms.
00:19Forms are all about the user interface.
00:20They provide the mechanisms that translate what it is that you want to get done
00:24to the inner workings of the database.
00:26In fact, in a well-designed Access database there may never be a need to
00:29actually even see a data table or a query or a relationships map.
00:33Those are all background processes that organize input and output, and once set
00:37up properly should just work with little maintenance.
00:40Forms handle all the grunt work of capturing user intent and moving it
00:43through the system.
00:44They help guide users through all of the available options.
00:47Now, I've gone ahead and open up the Exercise File that we'll finish this course with.
00:51This is the 1-1 TwoTreesCompleted Access database.
00:55Now, you might have noticed at the beginning the splash screen has started up,
00:58that helps tell our end-users that what's about to happen, that is loading the
01:01Two Trees Olive Oil Company database.
01:03Once that's on the screen for a few seconds, it disappears and the Main Menu appears.
01:06Now, I have a bunch of available options.
01:08I can choose for instance to view the employee directory. I'll click this.
01:12I can look through my employees, when I'm done reviewing this I can return to the Main Menu.
01:17I can also do things like enter a product review or perhaps I want to add a new
01:20customer, I'll click that.
01:22My Add a New Customer form is open, I can enter in the information and save the
01:25customer or I can cancel that entry. I'll press Cancel.
01:28I can even do things like Email Orders.
01:31I'm going to e-mail this report to somebody.
01:33I'll click on the button, Access package set up as a PDF file, it even opens
01:38up Outlook and addresses the e-mail and attaches it right here, ready for me to send.
01:42I'll go ahead and close Outlook.
01:44So, as an end-user that has never even seen this database before, we can
01:48accomplish some very specific tasks without even digging into any say Navigation
01:52Pane here on the left or any of the buttons that might appear on the Ribbon.
01:55If you think about Word as a tool for creating documents then Access is a tool
01:59for creating more tools.
02:00Now, I know that's a little abstract, so let me explain.
02:03You can use Access and have a fully operational database with nothing more than
02:07a few tables and queries, and in fact that's where a lot of other database
02:10programs end, but when you layer forms and reports on top of that data you start
02:14creating something more.
02:16It becomes a custom application or access the program doesn't really even matter anymore.
02:20You've created a custom tool that operates within Access but is tailored to
02:24your specific needs because in the end unlike with Word, the database file
02:29really isn't the end goal.
02:30The end goal is to have a place to store data to retrieve records easily and to
02:34manage the day-to-day operations of your organization.
02:37Your job as the database designer is to create the tool.
Collapse this transcript
Designing for the end user
00:00Throughout this title I'll often refer to the database as end-user and I wanted
00:04to take a moment to define who I think this person is and why they're important
00:08to keep at the front of your mind while designing your forms and reports.
00:11The end-user isn't anyone specific.
00:13They're more of a theoretical individual that is completely new to your organization.
00:17They maybe a new hire or an intern or maybe, even your grandmother, somebody
00:21that knows very little about your day-to-day tasks and even less about how to
00:24use Microsoft Access.
00:26As you develop your database application, occasionally put yourself in their
00:30position and look at your workflows as if you're brand-new to it.
00:33If you can set up your navigation and data entry and reporting systems tailored
00:37to the end-user that uninitiated first day on the job employee then you'll be
00:41well on your way towards creating a successful application.
Collapse this transcript
Exploring the database
00:00When starting any new database project it's really important to be familiar with
00:03the data tables that we will be working with.
00:05Throughout this course we are going to be taking a look at data from the Two
00:08Trees Olive Oil Company.
00:10Let's take a look at some of the data that we will be working with.
00:12On the left-hand side of my Navigation Pane I can see I have a bunch of tables,
00:15I have a table called DirectCustomers, Employees, FieldReps, Orders, and
00:19Products, I also have a couple of additional tables that are marked as lookup
00:23tables here with this tag for GradeID, OilID, Sizes, and States.
00:28Let's take a look at the Orders table.
00:29I will double-click on it to open it and we will review the data inside.
00:32The Orders table has fields for OrderID, OrderDate, the customer that placed
00:36the order and this is their ID number, the product that was ordered, and again,
00:40the ID reference, and the ID number for the salesperson that assisted with that order.
00:44Now if we go to the Database Tools menu here and take a look at the
00:47relationships, by pressing the Relationships button here, we can see how all of
00:51the data tables within our database relate to each other.
00:54So here is that Orders table, we can see the fields inside of the Orders table
00:57and we can see that if we take a look at the CustomerID, the CustomerID is
01:00linked to the DirectCustomers table based off of that ID number.
01:04So from the Orders table I can get the ID number, I can follow that to the
01:07DirectCustomers table or I can get additional information such as their
01:10first and last name, their address, the state that they live in, and their email address.
01:15Similarly, I can follow the ProductID to the left to the Products table and I
01:20can find out the name of the product, the size of the product, the cost of the product.
01:24Once I have that information I can find other information about that product.
01:27For instance, I can translate the size in ounces to the text name of its size,
01:31for instance small or medium.
01:32I can also find what oil it was made of and what the retail grade of that oil is.
01:36Now all of these tables are related to each other in this database which makes
01:40it very efficient and I can use the data in multiple ways.
01:43So this is the data that we will be working with throughout this course as we
01:46create forms and reports to organize it.
01:48Let's get started.
Collapse this transcript
Creating a form with the Form Wizard
00:00You can have a basic form up and running and as little as three clicks of a mouse.
00:04For instance in the Two Trees database here I can go to the Navigation Pane,
00:07click on the Orders table, on the Create tab of the Ribbon I can click on
00:11Form in the Forms group.
00:13Access will create a form here based off of that Orders table.
00:15Right now I am in Layout View which is one of the two editing modes.
00:19In the View menu here I am going to switch to Form View so I can work with the data.
00:23The data in this form is coming straight out of the Orders table.
00:25Right now I'm looking at record number one of 2200.
00:27I can see that it's OrderID 10000 that was placed on the 10/01/2005 and then it
00:33was for customer at 2461.
00:34Let's go ahead and see this data in the Orders table.
00:37If I double-click on the Orders table, I can see in the EDS that record number
00:41one is order 10000 on the 10th of January for this particular customer.
00:45Now the data in this form is a live link to the data in the table.
00:48For instance if I click on the OrderDate field here and get the Calendar
00:51Picker and I can change that date, click on the calendar and change it to maybe the sixth.
00:55I will click the Pencil icon here to finalize that change and then I can go to
00:59look at the table again to see the updated value in the table.
01:02Now this change goes both ways, I can make a change in the table and we will see
01:05that update in the form.
01:06I will click on OrderDate again, click on the calendar and change it back to the 10th.
01:11Once again I'll click on the Pencil icon or I could press Enter and move to a
01:15different record, we will go back to the form and we will see that the data is changed here.
01:18I'd like to think of these squares as little windows into the table cells
01:22that they represent.
01:23So the data here is the exact same data that you're seeing here.
01:26Okay let's go ahead and close the Orders table.
01:29This form while it is technically correct it's showing me data straight from
01:32that data table, it leaves a lot to be desired.
01:34For instance it's showing me this customer ID, but I don't know who this
01:37customer is, it's also showing me this ProductID, but I am not really sure
01:41exactly which product this means.
01:43I would like to have a better text description of this customer's name and the ProductID.
01:47Because our Access database is built around the idea of related tables you can
01:51get that information by incorporating a few more data sources into our form.
01:55Let's use the Form Wizard that will walk us through the process and get a more
01:57useful form than the one we have now.
01:59I will go ahead and close this form out and I am not going to save it, I
02:02will say No to save.
02:03Now we can to up to the Create tab on the Ribbon and click on Form Wizard, that
02:08will start up the wizard where we could choose the tables that we want to
02:11incorporate fields from.
02:12For instance let's go ahead and build a form similar to the one we just had
02:15except it has those other pieces that we wanted, the name and the ProductID, we
02:19will go to the Orders table and I will choose OrderID, OrderDate and then we
02:23will switch to a different table here.
02:24We will pull in information from our direct customers table.
02:26I will click on that and we will add FirstName and LastName, and finally I will
02:31choose my Products table, I'll go back up to the dropdown, choose tbl_Products
02:34here and we'll get the ProductName and I'll add that from the available fields
02:38to the selected fields section.
02:39We will go ahead and say Next.
02:41The Next screen asks us how we want to view our data, if I choose by tbl_Orders
02:46it's going to show me one page of the form for every record.
02:48If I choose by tbl_Products you will show me a product name in all of the orders
02:52that are associated that included that product, likewise if I click on
02:56DirectCustomers they will show me a customer name and then all of the orders
02:59that that customer has placed.
03:00We will look at these options here in just a moment.
03:02So for now just click on tbl_orders and we will click Next.
03:05We will go ahead and choose the default format for the layout, say Next here and
03:10now we can give our form a title if you'd like.
03:12I am just going to accept the default title here and I will choose to open the
03:15form to view or enter information, we will say Finish.
03:18So already we've got a form that's better than the one that we created just a moment ago.
03:22I have got the same OrderID and OrderDate, but now I know who placed the order
03:26and what exactly they ordered.
03:27Let's take a look at a couple of other options that we had in the wizard.
03:30I am going to go ahead and close this form here, go back to the Create tab and
03:34choose Form Wizard again.
03:36Let's build the same form and we will choose a different option later on.
03:39So I will go for the Orders table, I want OrderID and OrderDate, go back up
03:43here to the DirectCustomers table where I got first name and last name, once
03:48again I will go to the top and this time I will choose tbl_Products to get the product name.
03:52We will say Next.
03:54And this in this screen we are going to choose by tbl_Products.
03:57Now Access gives us two different options, I could either have the Form with
04:00subforms or Linked forms.
04:02Let's go ahead and choose Form with subforms now and we will look at Linked
04:05forms in just a moment.
04:06Go ahead and say Next, we will accept the Default layout, Next.
04:09We will accept the default names, go ahead and say Finish.
04:13Here is a form with the subform attached to it.
04:15Now I could use a little bit of help in the layout, but what it's showing us
04:18right now is that I have got 90 different products.
04:20For those 90 products these are all of the OrderIDs and OrderDates and customers
04:24that have placed orders for that product.
04:26I could scroll through my products here, for instance, I will go to product
04:30number 8, the Extra Virgin Oil, 32 ounce size and I guess all of the customers
04:35that have ordered that product.
04:36And I've had a total of 21 different orders.
04:38Let's go ahead and close this and we will look at the other option.
04:41Once again to the Create tab Form Wizard, we will build the same table.
04:45So I will take OrderID and OrderDate, we will go to the Customers table, we
04:49will add FirstName and LastName and we will go to the Products table and choose ProductName.
04:56Okay, once we get those five fields we will say Next.
04:58This time we are going to choose by tbl_Products again, but we will choose the
05:02Linked forms option.
05:03This will show us the same data in two separate forms that we got on the last
05:07one with a subform, go ahead and say Next.
05:09This time I am going to change the names, we are going to go ahead and use these
05:12two files in next exercise.
05:14So for the first form we are going to call it Product Selection.
05:18In the second form we are going to call Orders By Product.
05:21Go ahead and say Finish here and Access will update those forms.
05:25Now we've got a little bit of a problem here the default selections create this
05:29button that appears behind this label.
05:31So if I try and click on the button, I can't, the label is in front of it.
05:34In order to fix this I actually need to jump into Layout View for just a moment,
05:37we are going to look at Layout View in the next movie.
05:40But for now just go ahead to the View menu, choose Layout View, we will click on
05:44the title here and I am going to click-and-drag to side it over.
05:46Then I'll click on the button to click-and-drag and side it over and it will
05:50move the label back.
05:51Okay, now that they are separated we will go back into Form View and I will test
05:55out the functionality.
05:57Just like the last form I can cycle through my products here, so I'll go to
06:01record number 6 here, the Extra Virgin Oil, and the 8 ounce size, and I will
06:05press the Orders By Product button.
06:07When I press that I get a second form that opens.
06:10You might have noticed in the Navigation Pane here, when it opens up it's
06:13showing me all of the records for each customer that have placed orders for that product.
06:16You can see I have a total of 27 records or 27 orders for that specific oil.
06:21So using the Wizard we were able to create three slightly different user
06:25experiences and using data from multiple-related tables we were able to get
06:29details on order activity at the Two Trees Olive Oil Company.
06:32Now as is typical with the objects created with a wizard we have a good starting
06:36point but we need to clean this up a bit before it's presentable.
06:39We will take a look at the Layout View in the next movie to finish this form.
Collapse this transcript
Refining the form in Layout view
00:00The Form Wizard gave us a good head-start on setting up a couple of forms that
00:03will allow us to select a product and get a listing of all the orders that
00:07included that product.
00:08Now we need to polish up the layout a little using the tools available to us
00:11in the Layout View.
00:12In the last movie we created this Product Selection form.
00:15I'll go ahead and double-click on it and you will see that I could scroll
00:17through the records to select different products in our company and I can choose
00:20the Order By Product button to see a listing of all of the orders that included
00:24that particular product.
00:25Now we can clean up the design of these two forms by using the Layout View.
00:29First let's take a look at some of the things we might want to change.
00:31In this form when we go to Product Selections first of all I want to change
00:34the background color to better align with the Two Trees Olive Oil Company's color scheme.
00:38Second, I want to get rid of the box around this label here.
00:41I also want to change the styling of this button.
00:44Now in the Order By Product's form, click on that, again I am going to change
00:47the background color here, I want to change these labels here, the OrderID,
00:50OrderDate, FirstName and LastName, right now these values are coming straight
00:54out of the data table, those are the fields from the table.
00:57I want to make them a little more human-readable by adding spaces between them.
01:00Next I want to get rid of the boxes around the data, these boxes don't really
01:03add anything to the legibility of my data, so I can get rid of them to clean
01:07up the visual clutter.
01:08And then I want to reduce the height of each record, so they are not using up so
01:11much space and I get fit more vertically.
01:13Okay, let's go ahead and go into Layout View to make those changes.
01:16First our Product Selection form, I'll click on it here and in the View menu I
01:20will switch to Layout View.
01:21I can click on the background color here and switch the Format tab where I can
01:25find my paint bucket, I'll use a drop-down menu and we are going to go ahead
01:29choose this Color Swatch here, the Olive Green, Accent 3.
01:33Next I want to change the styling of the button, I'll click on the button, and
01:36under the Quick Styles menu I am going to choose this light green option here.
01:40Next I want to get rid of the line that surrounds this bounding box.
01:43I will click on the object here, and in the Shape Outline I am going to change
01:46it to Transparent so it's invisible.
01:48I will click off anywhere in this white space to see what the results look like
01:53and that's looking pretty good.
01:54So I am going to switch over to the other one, Order By Product.
01:57Once again I am going to select Layout View, I go into View menu here and go into Layout.
02:01Next I am going to change the color of the background by clicking on the
02:04background blue, into the Format tab, I'll click on the Paint Bucket icon, which
02:07is already loaded with the green color.
02:10Next I want to change the labels here.
02:11But if you remember in the last movie we had to adjust the label because it was
02:14over the button, well that applies to this form as well.
02:17First I will click on this label and you will see that the box is actually
02:19covering these other three labels.
02:21I am going to click on the bottom here and drag it up.
02:24Now I can click on these forms down here, I will double-click and I will add a
02:27space in between, so it's little more legible, double-click on OrderDate and add
02:31a space, double-click on FirstName and add a space and double-click on LastName
02:35and add a space, and I will click out here to select.
02:37Next I want to change the height of my records.
02:40I will go ahead and click on this FirstName one here and I'll Shift+Click to
02:42select LastName at the same time.
02:44Now I need to drag these up to match the height of the OrderDate and OrderID fields.
02:49And the handle here gets a little tricky if you're too low you'll end up
02:51dragging the top of the one below.
02:53So you kind of need to be a more than halfway up between those two lines, right about here.
02:57I'll click and I can drag up.
02:59That will collapse my form vertically so I can get more data on the screen.
03:03Next I want to get rid of these boxes, I'll Shift+Click to select the other two
03:06fields and then I will go to Shape Outline and say Transparent.
03:11Select off of it, now let's switch back to Form View by going to the Design tab
03:15and clicking the View to Form View.
03:16I could find the same icon by going to the Home tab and clicking the icon there as well.
03:20So I will switch back into Form View and that's looking pretty good.
03:23So I am going to go ahead and close this down and I'll save my changes, yes, and
03:28this one looks good as well, I will close it as well and save the changes.
03:31So now let's take a look at how the workflow is working.
03:34I will double-click on Product Selection, I can scroll to my records, I can
03:39click Orders By Product and I can see a better look at my data.
03:43So the Layout View gives you some easy-to-use tools for organizing the flow of
03:47your forms and making sure that everything is aligned.
03:49For even more flexibility we will need to dive into the full design environment
03:53and we will do that in the next chapter.
Collapse this transcript
2. Form-Design Basics: Creating a Directory
Organizing the form elements
00:00Combining the Form Wizard and layout views are easy ways to get started creating
00:05your database's forms, but the real power and flexibility lies in utilizing the
00:09full design environment for creating forms from scratch.
00:12Once you understand what's going on under the hood creating your own forms that
00:15need your exact specifications and needs will become second nature.
00:19Let's start by creating a Rolodex style employee directory for Two Trees.
00:23Now I've got a finished example here called rfm_Employees-Complete that we can
00:28take a look at to review the kind of direction that we are looking.
00:30I will double-click on that to open it and you will see I have a scrolling form
00:34here that's showing me information for my employees table.
00:37I can scroll through here and see photos of all my employees, easily find their
00:41name, their phone number and email address, as well as their physical address,
00:44what department they are in, and their hire date.
00:46I also had a little bit of fun with some of the fonts and I put their employee
00:49number here and I put the name of the state that they live-in over here.
00:52I can see this list scrolls and I have got a header up here at the top
00:55that doesn't scroll.
00:56So this is the kind of thing that we are going to be creating.
00:59Now our finished version might look a little bit different because some of the
01:02design decisions that we make are going to be a little subjective.
01:05So things might not be in exact same spot but that's okay, it's really flexible
01:08we can always change it up.
01:09So let's go ahead and close this down and we will start making our own form.
01:13First we will go up to the Create tab of the Ribbon and in the Form section we
01:17will click on Form Design.
01:18That will create a blank form editing session, where we can start working.
01:22The first thing that you want to do with starting a new form is connected to a data source.
01:26So I will go over here to add existing fields and I will click on that to open
01:30the window and I am going to click on Show all tables.
01:32This will show me a listing of all the tables that are in my database.
01:35I can use the Plus symbol to expand the field, for instance I'll click
01:39the Plus over here next to tbl_Employees to see all of the fields within that data table.
01:43Let's go ahead and add a field to our form.
01:45I am going to click-and-drag FirstName and drop it in the Form area.
01:49Now when you click-and-drag a field into the form area we actually get two elements.
01:53The first one over here on the left is a label, basically this is just the name
01:57of the header from the table, the second one over here is a textbox, and this is
02:01where the data will appear as we scroll through our records.
02:04So this is what's going to get populated with the actual first name of the employee.
02:07Now when we are moving elements around on the form, the behavior is
02:10slightly different than what you might have experienced in Publisher or
02:12PowerPoint or Word.
02:13We've got these handles around the edges, the one on the top, the three on
02:17the right, the one on the bottom and these two over here on the left side
02:20will all resize my object.
02:22For instance, I can click on this one in the middle to make it wider or I can
02:25click on the one down here to make it taller.
02:28If I click anywhere on the orange bar I will get this crossed arrow, I can
02:32click-and-drag to move my object around;
02:34but when I do, the associated label comes right with it, it maintains its same relationship.
02:38If I click on the gray box up here in the top-left corner I get the same
02:41double-headed cross arrow, using that handle I can drag the two elements
02:45independently of each other.
02:47Now that they are in a different relationship and I tried moving it using the
02:50orange over here they will maintain that new relationship.
02:53So go ahead, I am going to move this around, I am actually going to put it
02:56underneath FirstName here, and now if I were to drag it around FirstName
03:00will come right with it.
03:01So that's moving objects around, it takes a little bit of getting used to
03:03because it is different from what you might have experienced before, but that's
03:06how all of the objects in Forms and Reports work.
03:09Okay, let's add a couple of more fields to our form here.
03:11I have already got first name, let's go ahead and add LastName and I will
03:15click-and-drag these over, Phone number, this time I will just double-click and
03:18that will add it into the form.
03:20Address, City, State, Zip, Email, HireDate.
03:26I don't want everybody to see their hourly rate of pay, so I will skip that one,
03:29but I will do Department and Photo.
03:32Now that all of the fields are in my form I can go ahead and rearrange them into
03:35the positions that I want.
03:36Now all of these fields came with an associated label with it, for instance,
03:40I've got Photo here and then the Label photo.
03:42Now this might be a little bit redundant, I don't need a label to tell me that
03:45this is a picture of the employee.
03:46So I can get rid of some of these.
03:48I am going to click on the Photo label and delete it.
03:49The same thing applies to the Address, I don't need a label that says
03:53City, State, and Zip;
03:54all I want is the one that says Address.
03:55So I will get rid of City, State, and Zip labels;
03:59same thing applies to the first and last name, I think that's going to be pretty
04:02clear so I will get rid of the FirstName and this LastName label as well.
04:05Okay, now I am going to start moving elements around.
04:08The first thing I want to do is get myself some space to work.
04:10So I am going to drag a box around all of these and just drag them out of the way.
04:14I will click off to deselect and now I can grab each element and put it where I want.
04:20First I am going to drag the photo and put it in the top-left corner.
04:23And I will resize it a little bit to maybe about the one-inch mark and about an
04:27inch-and-a-quarter down.
04:29Next I am going to move the name to the very top.
04:31So I will start with the FirstName box which is this one here, move that up to
04:34there, and then I will move LastName up as well.
04:37I also want to give myself a little more room for the LastName, so I will
04:40make that box wider.
04:41Now below FirstName and LastName I want to put their phone number, I will take
04:45Phone and drag that up.
04:47Now I am going to line everything up against the two-inch mark here, below Phone
04:50I am going to put Email.
04:51So I will click-and-drag that one up as well.
04:54Below that I will put their Physical Address, take Address, move it up.
04:58We will put City, State and Zip all on one line.
05:01So we will take City there, State here, and Zip next to it.
05:06Finally we will put HireDate and Department down in the bottom.
05:10HireDate and Department, we will put over here to the right.
05:15Now the grid in the background is kind of a snapping grid so when you move all
05:18this around they tend to snap to these corner points, that helps with the
05:21alignment and everything and keep everything spaced properly.
05:24Next let's move these labels a little.
05:26Department, I need to move that closer, so I will use the handle here and we
05:30will drag that closer to department.
05:31HireDate, I am going to move that over as well, and we can drag to here.
05:35And we can use some of the tools up here on the Arrange tab to help us with
05:38the alignment as well.
05:39For instance if I select all of these labels at once by dragging a box
05:43around them, nope, but I don't want to select Photo, so I will deselect,
05:46just those labels here.
05:47I can go over to the Align menu in the Sizing and Ordering section, click that
05:52Down box and say I want to align everything to the rightmost object which is
05:55that HireDate box, and then I will move accordingly.
05:59Finally I am going to make my Address field bigger.
06:01I know I am going to need more room for that so I will just drag that wider.
06:04And while I am here, Email address that should probably be wider as well.
06:08Up on the Arrange tab of the Ribbon, there are some other tools that could help us out.
06:11If I wanted to ensure that everything was lined up we've already seen the Align
06:14tab which will have us align everything to a specific object.
06:17I could also use the sizing and spacing which will help me resize everything to
06:21a common size or space everything so they are equally-spaced.
06:24Let's switch into the Form View to see how our form is looking.
06:26I will switch to the Home tab and press Form.
06:30Now I can see the data is being populated in and I can scroll to my records
06:33here, we can see the photos, the names and all the data is being populated.
06:37So let's go ahead and save this form, I am going to save it as Employee
06:41Directory and you can either press Ctrl+S on your keyboard or press this disk
06:45icon up here, we will name this Employee Directory, and press OK.
06:51That will save it down on the Navigation Pane and we are going to continue
06:54working with this form throughout the rest of this chapter.
06:56Now we can continue to finesse these positions as we develop our form, and truth
07:00be told, form design will require a lot of back-and-forth if the final layout
07:04gets further refined.
07:05Now that we have our Form Field elements in roughly the position that we want
07:08them, we can take a look at some of formatting options that are available.
07:11We will pick it up there in the next movie.
Collapse this transcript
Formatting
00:00In the last movie, we looked at how we can add references to our data tables
00:04with the field list and how the arrange tab in the Form design will help you
00:07organize elements on the page.
00:09Now let's turn our attention to the Format tab.
00:11The Format tab has many of common formatting options that you might recognize
00:15from other programs, such as Word or Excel.
00:17Right now, I have got the Employee Directory form open that we're working with earlier.
00:20I am going to change its View to Design View by going to the View menu and Design.
00:25On the ribbon up here, I am going to change the Format tab.
00:28We will take a look at this.
00:29One the left side, I have got a Selection section, in the drop-down menu where I
00:32can select different object on my form.
00:34Now I can select from any object here, if I select Address for an example, here
00:37I will choose Address Box.
00:39If I want to choose one of the labels, I can choose say Label2 here, I am not
00:44sure exactly which one label 2 is though, apparently it's the phone number one.
00:47So I could choose objects here from this menu.
00:49I could also say Select All and it will select everything.
00:52I will go ahead and click down anywhere in the space down here to deselect.
00:56The next section changes Fonts.
00:58So I am going to go ahead and click on first name here where I could change the
01:01fonts here if I wanted to, I could change the size which I will.
01:04I am going to go ahead and change this to a 14 point.
01:06I can change whether it's Bold, Italicized or Underlined and I am going to choose Bold.
01:11I can change the Font color, right now its looks kind of a dark gray and it is,
01:15you can see it here.
01:15Let's go ahead and change it to black.
01:17I could also change the font background.
01:19And now this is going to change the background color of the entire bounding box.
01:22So for instance, if I choose this red color here, Red Accent 2, I will see it
01:26fills up the entire space underneath the orange.
01:28I will go ahead and change that back to Automatic.
01:31I can choose whether, I want to take my text Left aligned, Centered or Right
01:35aligned and this tool up here is a paint brush, it's call the Format Painter and
01:38we will take a look at that in just a moment.
01:40The next section is called Number and it applies to numerical data.
01:43So for instance my HireDate, it is a date field, it is a number, if I select
01:47that, it will give some options here to deal with those numbers.
01:50For dates, I can either choose to display them in their standard format or I can
01:53display it in a different format.
01:55For instance, I am going to choose Medium Date and we will see the result of
01:57that change in a little bit.
01:59The next section here Background, you can apply Background Image.
02:02Now it doesn't matter what object you have selected if you choose this
02:04Background Image, it's going to apply the Background Image to the entire form, back here.
02:08So it doesn't matter if I have HireDate selected or nothing selected,
02:11choosing this Background Image option would apply a Background Image to the
02:14entire form regardless.
02:16And over here I have got Control Formatting which would change to a Quick Style
02:19or Shape for things like buttons or other shapes.
02:21I have got Conditional Formatting which we will look at later in this course and
02:25I could change Shape Fill, Shape Outline, or Shape Effects, for things like
02:28Rectangles, and Lines and Buttons.
02:31Okay so let's go through and change a couple of the objects here.
02:33First of all I am going to change the boxes, it appear around all of my text objects.
02:37I can go to the Select All menu to just grab everything it wants and I will go
02:41to Shape Outline and change it to Transparent.
02:43So we won't see those boxes around all of our data fields.
02:46Next I want to apply the same formatting to Last Name that I have now on FirstName.
02:50I can select the FirstName box, click the Format Painter and click on LastName.
02:55Notice that when I click on LastName, it deselects the Format Painter up here.
02:58If I want to change all these to the same size, I could do that in different way.
03:02I might choose the phone number one for example, change it's Font size, maybe down to 10.
03:07I could double-click on the Format Painter to lock it on and now I can paint
03:10multiple objects at once.
03:11So I click on Email, Address, City, HireDate, State, Zip, and Department and I
03:17click on Format Painter to turn that off.
03:18The other thing I can do is Shift+Click to select multiple objects.
03:21So let's say I want to choose these labels here.
03:23I will click on Phone number, I can Shift+Click, on the other labels here on my
03:27form and I can change their formatting all at the same time.
03:30Let's say I wanted to make them a green color.
03:31I will click on the Font Text here, and I will make them this dark green, Olive
03:36Green, Accent 3, Darker.
03:37So let's go and see the results of our changes, I will go to my Design Tab and
03:42click on the Form View button here and I will click on here, so that's
03:45de-highlighting the name here.
03:47So I do see one little error that I want to change here, I can see that the word
03:50guy here, the y is being chopped off the bottom, I need to adjust the size of my
03:53textbox a little bit.
03:54Let's go back into Design View and fix that real quick.
03:57Click the View menu>Design View.
03:59I will click FirstName and LastName at the same time and I am going to press the
04:03Shift+Up button and that can make it shorter.
04:05If I press Shift+Down that will make it taller.
04:07If I press Shift+Right that will make them wider, if I press Shift+Left that
04:11will make it narrower.
04:12So I am going to press Shift+Down a couple of times to make the boxes taller
04:15and then I am going to let go the Shift key and I will press the Up arrow to
04:18move the objects up.
04:19That's probably going to work out better, we will click on the Form View button
04:22here and that's looking better for the names.
04:25Okay let's go ahead and save our changes, press the Save icon here and our form
04:29is set for the next movie.
04:30Now the Design tab puts many common controls right up front in the ribbon,
04:34changing fonts and colors and line styles here could be really quick especially
04:38if you make good use of the Format Painter tool.
04:40But for some serious control over every aspect of our forms we are going to need
04:44to dig a little bit deeper and explore the Property Sheet.
Collapse this transcript
Modifying the form through its properties
00:00The Format tab on the Ribbon gives you a quick place to change some of the most
00:03common settings for your form elements, such as color, font, and size. But those
00:08options are only the tip of the iceberg when it comes to the vast number of
00:11properties that each element possesses.
00:13To see the full list, we will have to dive into the Property Sheet.
00:15I have got my Employee Directory form open form the last movie.
00:18We are going to go ahead and change our view back to Design view here.
00:21We will go ahead and get rid of the Field List window by clicking the x here, and
00:25I am going to turn on the Property Sheet.
00:27The Property Sheet has lots of different ways you can get to it.
00:29First you can find it in the Design tab of the Ribbon, under the Property Sheet
00:32button here, and I can press the shortcut key Alt+Enter or another shortcut key. F4
00:38and that one is actually my favorite one.
00:39The other way you can do it is just double-click on an object.
00:41For instance, if I double-click on my LastName here, it will open up the
00:44Property Sheet for that object.
00:46Now every object on your form, including the background, if I click back here, and
00:50the form itself, if I click on the box up here, have properties.
00:55Let's look at some of the things that we might want to change.
00:57Let's go back into Form view for a moment.
00:59Now in my Employee directory, first of all, I want to make this a scrolling
01:02form, so that each record appears right on top of the other.
01:06Next, I want to get rid of some of the clutter.
01:07This thing over here on the left side is called s record selector, this big
01:10gray bar with the arrow on top of it. You can click on it and it turns black, but
01:14it doesn't look like it does anything else.
01:16Let me show you a record selector at a table, just so you can see what this is.
01:18If I open up the Employees table here, the record selector is this gray box
01:23here. It selects the entire row.
01:25So I can go through and select different rows.
01:26That's what a record selector is.
01:28Let me close the table.
01:30So in the form right now, the record is this entire thing.
01:33So the record selector extends all the way from the top to the bottom.
01:36But essentially what I have done by selecting this is select the record, just
01:40like if I had done that on the table.
01:41The other thing I want to get rid of, since this will be a scrolling list, are
01:44the Record Navigation buttons down here at the bottom. It will be a scrolling
01:47list, so I don't need to have this.
01:49Finally, I want this to be a review-only document.
01:52I don't want people to be able to go in here, for instance, and start changing
01:55data, like renaming people or changing their phone number.
01:58I want people just to be able to look at this and not edit the data that's in
02:01the underlying data table.
02:03So let's make those changes in the Property Sheet.
02:05I am going to change the View menu and go back to Design view.
02:07I am going to change the Property Sheets for the form. Again the shortcut for
02:11that is this button right here between the two rulers and click that so I get
02:15this black box here.
02:16I can also change to the property of this specific object by using this drop-
02:19down menu in the Property Sheet.
02:21Here I can find the listing of every object, including every label inside of my document.
02:25I am going to choose Form.
02:27Now we're at the Properties for the form itself.
02:29The Property Sheet is made up of five different tabs.
02:32The Format tab here has options to deal with formatting, including a Caption,
02:37which would appear on the tab up here at the top, any kind of Default Views,
02:40pictures, borders, colors, scrollbars, and things like that.
02:44Let's go through and change some of these.
02:46First of all, I am going to change the default view.
02:48I will change it from Single Form, and using the dropdown menu here I can change
02:52it to Continuous form. And I am actually going to make this little wider so we
02:55can see the whole thing. There we go.
02:56So the dropdown said Continuous Forms here.
03:00We can change what View modes are allowed. These will control what shows up in
03:04the Views button here.
03:05So for instance, I have no need to see PivotChart or PivotTable or Layout or
03:10Datasheet view; I can turn all those off here in the Property Sheet.
03:14So Form view is the standard for interacting with it. I want to make sure I keep
03:17that. But for allow Data Sheet view, I will change the dropdown to No.
03:21Now instead of using the mouse, you can use your arrow keys to move around.
03:24I could use the down key to move down and the up key to move up or if you prefer
03:28the right key and the left key to move down and up.
03:31If you prefer left-handed controls, Tab will move you down and Shift+Tab
03:35will move you back up.
03:36While you are in the left side Ctrl+Tab will cycle through the tabs.
03:40Now we could go through and change some things again.
03:41I will press Shift+Tab to move up to allow PivotTable view and instead of
03:45using the dropdown menu, since I know my only two options are yes or no, I
03:48can press N to go to No.
03:50I will press Tab to go down a view and again PivotChart View, that one is no as well.
03:54Next one down with tab, Layout view, nope, don't want that one either.
03:59The next one I want to change is the Record Selectors.
04:01That's about halfway down. So I am going to press Tab a few times until I
04:04get to Record Selectors, and it's right there. I am going to turn those to No as well,
04:08so I will press N. And right below that there is Navigation Buttons.
04:11Those are the ones that appear at the bottom. I am going to change that to No as well.
04:15Two more down is Dividing Lines.
04:17Since this will be a scrolling from, with each record appearing right on top of
04:20itself, I can turn on dividing lines to provide a visual cue where one record
04:23ends and the next one starts.
04:25I am going to press Y to change that to Yes and press Tab to finalize that.
04:28Let's take a look at some of the options in the other tabs.
04:31I will switch to the Data tab.
04:32We can use the mouse here to click.
04:34The one that I want to take a look at first is this Recordset type.
04:37Right now it's set to Dynaset.
04:39This is providing the dynamic link between the form and the data table behind it.
04:42If I change this here to Snapshot, that will prevent people from being able to edit the data.
04:48This will just show a snapshot of the data table as it existed when the person
04:52first opened that form.
04:53Let's take a look at the next step.
04:54I will click on the Event.
04:56The Event tab has all the different ways that you can control running
05:00macros from your form,
05:01so for instance, when a user clicks on something, or down here, if they double-click.
05:06I can trigger a macro when somebody clicks the mouse down and another if they
05:10have clicked the mouse up, using these two properties here.
05:12There's lots of different ways that you can add interactivity to your forms and reports.
05:16Let's look at the Other tab.
05:17The Other tab has miscellaneous options. For instance this Pop Up one here, if
05:21I change that to Yes, that will make it a floating pop-up window instead of the Tab window.
05:25If I change the Modal property to Yes, that will force the user to have to
05:29interact and close the form before Access will let you do anything else.
05:33And finally, the All tab here has a long master list of every other property in
05:37the other four tabs.
05:39So if I can't remember where it is in these other four tabs, you can always come
05:42to the All list and find it here.
05:43Now let's take a look at the changes that we have made here in the Property Sheet.
05:46I am going to up to the View menu and change to Form view.
05:50Now you can see it's a scrolling list of all my employees.
05:53I can see a slight problem here.
05:55I can see that I have got a lot of white space in between each record, so I can
05:58go through in Design view and tighten that up a little bit. Go back into Design
06:02view. Now scroll down to the bottom here, until I get to the bottom of my form,
06:05which is this bar right here, and I will click and I will drag that up little
06:08closer to my records.
06:11Now each one will be a narrow view. Back into Form view again and there it is.
06:16It's looking pretty good. If I scroll through my employees, we get a nice,
06:19continuous rolodex-style list going.
06:22So the property sheet is an extensive resource of everything you might want to
06:25control in your database, and you will be happy to know that both forms and
06:29reports share this common interface.
06:31While some of the most common settings can be changed through the Ribbon tabs,
06:34the Property Sheet is generally my go-to Resource because it gives access to
06:38all of the available settings, not just the most common ones, and often I found
06:42the Property Sheet to be a great discovery resource too.
06:45It allows you to find settings and options that you didn't even know you wanted
06:48to change until you saw it in the list.
06:49Now I am not going to be able to go through all the properties in this course,
06:52but I definitely encourage you to scroll through that list and explore it further.
Collapse this transcript
Adding a header and some polish
00:00We are going to wrap up our rolodex- style employee directory here and add a
00:03final bit of polish using the Property Sheet to modify some additional
00:06objects within our form.
00:08We will start by adding a header section that will appear at the top of our form
00:11so that our end users will immediately know what they're looking at.
00:14As we go through this, keep an eye on the Property Sheet and you will see the
00:17values change as we move things around and make selections.
00:20I have got my employee directory open here, and one of the changes we made in
00:24the last movie was to remove some of the View modes.
00:26So now if I want to change the Design view, all I need to do is press this
00:29Design button right up here.
00:30The View mode that we are not going to be using have disappeared from this list.
00:34So it makes it really easy to toggle back and forth between Design view and Form view.
00:38So I will just click the button here. That will put me back into Design view. I
00:41can open up the Property Sheet, if you remember those shortcuts: Alt+Enter, F4
00:46double-clicking, or using the Property Sheet button here.
00:49So however you want to do it, go ahead and open up that Property Sheet.
00:52Now the first thing I want to do is add that header section at the top where my titles will appear.
00:55I am going to right click on the Detail bar right here, and I am going
00:58choose Form Header/Footer.
00:59That will put a header section at the top and a footer section down here at
01:03the bottom. And we are not going to be using the footer, so I will go ahead and
01:06scroll this up to the bottom and get rid of it.
01:09The header section, I am going to go and expand it a little bit so I have some room to work.
01:12I will click here and drag it down.
01:14The next thing I want to do is add a logo to this top-left corner here.
01:17There is lots of different ways that you can add images into your forms. You
01:20could either use this Insert Image button here. We can use the Logo button here.
01:24The Logo button will add a formatted image and I will drop it in the top
01:28left corner right here.
01:29I like to use the Insert Image button better, because one,
01:31it will give me a gallery of images that I have already used here and two,
01:35I find that I have more control over an image when it's not locked into this Logo type.
01:39So I am going to click Insert Image and then browse.
01:42We will browse into our Desktop, Exercise Files, the Chapter 2 folder, and we
01:47will find TwoTreesLogo.
01:48Go ahead and say OK.
01:50Access gives me this little box here, my cursor has changed across here with a
01:53little image icon, and I will just drag out a box to place my logo. And there it is.
01:58Now let's add a couple of labels here.
02:00I am going to add some titles,
02:02so I will click on this Title button right there. That will add a title to my form.
02:05I am going to ahead and accept this name of Employee Directory; it's pulling
02:08that from the name of the form right here.
02:10But I want to format it a little bit.
02:12Now I could go up to the Format tab here and change the formatting. I could also
02:16change it down here in the Property Sheet.
02:18Let's go ahead and change it in the Property Sheet.
02:20First of all, I am going to change the font. Instead of Cambria, I am going to
02:23change it to Calibri.
02:24And I will leave it at an 18-point size.
02:27I will leave the Text Alignment to left here and actually this is kind of
02:30interesting. Let me show you.
02:31The Text Alignment options up on the Format tab are left aligned, center, or right aligned.
02:36Down here on the Property Sheet, it's currently set to left. If I use the drop down
02:39menu, I have Left, Center, Right, but I also have this Distribute option, which
02:43will distribute the letters across the entire bounding box.
02:46So that's an option that you only have available in the Property Sheet and not
02:49up here in the Ribbon. I am going to switch it back to Left.
02:53Now I can go ahead and change the color of this font.
02:55I could change it up here on the Ribbon or I can change it down here on
02:58the Property Sheet.
02:59I am looking for the Fore Color, which right now is set to Text 2.
03:02I will click on the Build button, and that will give me the color picker and I am
03:06going to choose this dark gray right here.
03:07It's Black, Text 1, Lighter by 15%.
03:11Now I am going to move into position. Because I use the Title tab instead of just
03:14placing text on my own, it's kind of locked in here in the top corner.
03:17I can move it around using the handle that's way over here on the left,
03:20so it looks like it's little bit away from the label.
03:23I will click and drag that over.
03:26Now when I change this background color back here, I want to make it a green
03:29color that matches our logo.
03:30I will click on this background, right over here there is nothing selected, and
03:33into the Format here, I will change Back color to a specific color.
03:37I will use the Build button and instead of choosing one of these color chips, I
03:41am going to say More Colors and I am going to type in the value.
03:44Now I know that this logo color is 185 for Red, 198 for Green, and 170 for Blue.
03:51I will type those values in and say OK.
03:54Now my background color matches the logo.
03:57The last thing that I want to change are these labels down here on the detail
04:00section of my report.
04:01Earlier in this movie, I changed them to a dark green color, and the more I look
04:05at it, I think it distracts from the actual data here,
04:08so I might go ahead and change those using the Property Sheet.
04:10I will click on Phone. Now I will Shift+Click on all the others.
04:14Now in the Property Sheet, I can change their properties.
04:17First I am going to change the Size down. I am going to change those to 9. And in
04:21the color, right down here where it says Foreground color, I will use the Build button
04:25and I am going to chose a gray color,
04:27maybe this white background darker by 25%.
04:30Now let's take a look and see how this form is working. I will go back to the
04:33Design tab, switch to Form view, and there we go.
04:36You know now that I am looking at those, those look a little too light. Let's go
04:39back and change it one more time. Go back into Design view. They are still
04:42highlighted, so I can click on the Build button here, and we will choose a darker
04:46color. How about this one here, the 50%?
04:51Go to Form view, and that's looking better.
04:53I can see it now, but it is not distracting from the actual data.
04:55Let's go ahead and scroll through our form, and you can see that I can scroll through
04:59by using the mouse here or you can scroll using the bar, and my header here at
05:03the top isn't moving.
05:05I also have these lines between each record, and all the fonts and graphics are
05:08looking aligned up properly.
05:10So there's our finished employee directory.
05:11The Property Sheet is really the master list of all the options that you have
05:15within your database.
05:16This applies not only to forms, but we'll see it again when we work with reports
05:20later on in the course.
05:21It may look a little intimidating at first, but I would definitely recommend
05:24that you spend some time reading through the list of available settings, and I am
05:28sure that you will come across a few of this to stimulate your brain and make
05:30you think of new functionality that you can incorporate into your database.
Collapse this transcript
3. Form and Report Controls
Introducing form controls
00:01In this chapter we're going to be taking a look at each of the control objects
00:04that are available to us when working with Forms and Reports.
00:07We've seen a couple of them in the last few movies, but I think it's important
00:10to explore each one individually and see what some of the options we have are
00:13when working with them.
00:14In this movie we're going to take a look at the Selection arrow and the Label
00:17control, so let's start by going up to the Create tab here and starting a new
00:21form in Design View with the Form Design button.
00:23That will start a new form in Design View and for the purposes of this chapter,
00:27I actually want to change this default background a little bit, when you first
00:30start a form in Design View, Access places this dot
00:33and grid pattern in the background.
00:34This helps you align everything on your form, but I think that the purposes of
00:37these movies the dots are going to be a little bit distracting and make it hard
00:40to see what I'm doing.
00:41So I'm going to go ahead and change this a little bit.
00:43On the Property Sheet for my form I'm going to scroll at the bottom and these
00:46two properties here Grid X, Grid Y, and they're currently both set to 24.
00:50I'm going to change these to smaller value like six, which will reduce the
00:54density of the dots in the background, and I think that will make it easier to
00:56see on these movies.
00:57I will go ahead and save this form by pressing Ctrl+S and I'm just going to
01:00call this Controls.
01:01And we'll use this form throughout the rest of this chapter.
01:04Okay, so let's take a look at a couple of controls.
01:06Up here in the ribbon, on the Design Tab, I have got this whole section called Controls.
01:10This Controls box essentially a toolbox of all the different objects that you
01:14can add into your form.
01:15The first one here is the Selection arrow, and the Selection arrow isn't really
01:19a control because it's not an object that's going to go on your form, but it's
01:22what you're going to use to interact with all the different objects.
01:24The other one I want to look at in this movie is this one here, the Label.
01:27The label we have seen in prior movies, and this is a static bit of text, it
01:31doesn't change as you scroll through records on your form.
01:33Now this is a slightly confusing terminology because in other programs such
01:37as Word or PowerPoint when you want to put text on the page you use something called a Text Box.
01:41In Access the text box is this object right here, and in Access the text box is
01:45specifically tied to data in the data table.
01:47So when you want to place just a piece of static text, you're going to use a
01:50label, when you want to display data that's when you use a text box.
01:54So let's go ahead and take a look at the Label.
01:55I'm going to click on the control here and I will click down on my form to add a label.
01:59You notice that once I do that a couple of things happened the first thing is I
02:02get those box down here with a flashing cursor in it, ready for me to type.
02:05The other thing that happens is its deselected label and it's automatically
02:08switched back to the Selection arrow.
02:09Let's go ahead and just type in the word text and then press Enter.
02:12Now that object is saved and I'm back in the Selection arrow.
02:15If you want to add multiple labels at once or in fact multiples of any of
02:18these controls, you could simply right-click on the button and say Drop Multiple Controls.
02:22I'll click on that and now I can add multiple pieces of text at one time, so
02:26I'll click once and you notice it didn't automatically select the Selection tool
02:29here, It stayed on the on the label.
02:31So I'll type in text again and press Enter;
02:33now I can click third time, text again and press Enter.
02:36When I'm done I'll switch back to the Selection arrow here.
02:39Now in prior versions of Access, you used to be able to double-click on the
02:42button to add multiple options and that no longer functions in Access 2010.
02:45So just use a right-click menu and choose Drop Multiple Controls from there.
02:48So now that I have a couple of labels on my form I can do a few things with them.
02:52I choose the Selection arrow to make sure not selecting anything, and now I can
02:56click each individual piece.
02:57I can Shift+Click to select multiple objects by click off of them, I
03:00will deselect them.
03:01I can use the control handles with or around the edges to resize them.
03:05So I can drag up on the middle or right on the right side and if I want to move
03:08them around I can use either the handle in the upper left-hand corner or click
03:11anywhere on the bar between panels to drag them around.
03:14I can use the arrow keys on my keyboard, so I can move things down or right or
03:17up or left using the arrows.
03:19And if I want to resize them I can use the keyboard as well by pressing Shift
03:22and using the right arrow to enlarge it, the left arrow to shrink it, down arrow
03:25to make it taller, and the up arrow to make it shorter.
03:28And if I want to get rid of an object all I need to do is press the Delete
03:31key once it's selected.
03:32So I'm going to go ahead and select these other two, I am going to press the
03:34Delete key that will set this up for the next movie when we look at Lines and Rectangles.
03:37The Label Control is one of the most common controls that you'll be working with
03:40when you create Forms and Reports.
03:42You'll use them anytime you want a static bit of text, a title, or a piece of
03:46instruction to stay on your form.
Collapse this transcript
Using lines and rectangles
00:00The next two controls that I want to explore are the Line and
00:03Rectangle controls.
00:04They're useful for marking of space and grouping elements together in your forms and reports.
00:08Generally, they are pretty passive and not really all that exiting, but
00:11proper use of them can go a long way to making your forms and reports legible and unambiguous.
00:16Let's go ahead and open up this Controls form that I've got here, we've
00:19created in the last movie.
00:20Now right-click and say Design View to jump straight into Design View.
00:22Now the line control is here in the Design ribbon.
00:25I can click on it and drag out a line.
00:27Now lines have a kind of a weird property to them when they're completely
00:30horizontal like this or completely vertical like this they're invisible to you.
00:35The only way you can see what you're doing is to look at the ruler on the left
00:38side, while you're dragging out a vertical line or the ruler across the top when
00:41you're dragging out a horizontal line.
00:42Once I let go of the mouse though the line will appear and it will be selected.
00:46Now lines have a couple of properties associated with them, you can see them in
00:49the Property Sheet here.
00:51Under the Format tab, I change the Shape outline, so I can make them thicker or
00:55thinner, I can change that line type to dashed or dotted, I can change
00:58the color right up here.
00:59All of these properties are also available in the Property Sheet.
01:02So for instance I can change its style from Solid to Dotted or Dashed.
01:05I could change its Border Width from Hairline to 6 point, and I can change its
01:09color here using the Color Picker or selecting from a list.
01:12Let's take a look at the Rectangle Tool.
01:14We'll go up to the Design Tab, the rectangle is on the second row, and depending
01:18on the size of your screen all of the controls might appear on a single row or
01:21you might have a scroll through the list.
01:22You can also use this down arrow here that says more, and I click that all of
01:26the different controls that we can work with will appear.
01:28The Rectangle control is this one right here and it looks a lot like this other
01:31one here which is the Button Control, so I want to make sure that we're using
01:34the Rectangle and not a Button.
01:36The Button has the access in it, the Rectangle is just empty.
01:38So we'll choose a Rectangle Control, we'll drag one out as well.
01:41Now the Rectangle control also has a property into formatting of Shape Fill, I
01:45can use a Shape Fill here to choose a color.
01:47I can use the Fill Bucket here in the Font section to choose a color or I can
01:51change its color here the Back color right there.
01:53I can change its Border Style, Width, and Border Color here just like I can with the line.
01:58Now lines and rectangles also have another property which makes them really useful.
02:01I go to Arrange, you can take a look at this Anchoring button.
02:04Let me go ahead and click on the line and I'll click on Anchoring, and we can
02:07see that it's anchoring right now is in the top-left.
02:10With the default anchoring what happens is Access draws the line exactly as you
02:13place it, in reference to the top-left corner of your form.
02:16Let's change it to Stretch Across Top and see what happens.
02:19I'll click Stretch Across Top for the line, we'll go to the Home tab and press
02:22Forms and switch into Form view.
02:24Now we see that the line is much longer than what I drew it.
02:27With Stretch Across Top what Access does is references both the left-hand side
02:31and the right-hand side, so it maintains a space from the left to the line and
02:34the right to the line, and save the actual length of the line.
02:37So Lines and Rectangles play an important role in organizing other elements in
02:41your forms and reports.
02:42They can be used to mark of space or to group like elements together such as a
02:46box around a grouping of buttons.
Collapse this transcript
Organizing screen space with tabs
00:00A Tab control can be used to add extra space to your form or group similar or
00:04related objects together.
00:06A Tab control is a great way to organize your form, but it's not going to work
00:09very well on a printed report, since you'll only be able to see the first tab
00:12when it's printed and clicking on paper really doesn't work that well.
00:15Let's go ahead and open up our Controls form by right-clicking on it and
00:18selecting Design view.
00:19The Tab control is this button right here.
00:22We'll click on it once and we'll drag out a tab.
00:23I'm going to go ahead and draw a box that fills up most of the bottom of my form.
00:28Access adds in two tabs here.
00:29If I wanted to add additional tabs, I can right-click and say Insert Page; if I
00:33wanted to delete a tab, I can right- click and say Delete Page; and if I want to
00:37rearrange the tabs, I'd right-click and say Page Order.
00:40Access will bring up a Page Order dialog box, in which case I can move up or
00:44down the tabs however I see fit, okay.
00:47So what can we do with a tab?
00:48Well tab essentially doubles or triples or quadruples the screen real estate
00:52we have on each form.
00:53For instance, if I click on Page4, it highlights the content area of that tab.
00:57Anything that I put in here won't appear when I click on Page5.
01:01We can have discrete and individual content for every tab.
01:03I'll click on the Page4 tab, and I'll go ahead and just add a label in here.
01:07I'll select the Label control from the toolbox and I'll move down into the tab.
01:10Once I get over the tab area it turns black.
01:13This is Access's way of telling me that the next thing I'm about to do is going
01:16to go inside of this tab, not inside of the form.
01:18I'll click to add a label, and I'll just say, "This is page 4."
01:21Let's go ahead and click on the other tab. This time I'll just draw a line inside of it.
01:25I'll click on the Line control and I'll drag out a line.
01:27Okay, let's go ahead and take a look at this in Form view.
01:29I'll click on the Form View button here, and now I can see the tabs. I can switch
01:33back and forth between the first tab here and the second tab here, and I can see
01:36they've got different content in each one.
01:38Okay, let's go back into Design view. Now we can change the titles of these
01:41tabs. Page4 and Page5 really is not going to help me very much,
01:45so I'll click on the first one here, and in the Property Sheet, I'm going to
01:48change the caption for the tab.
01:50The caption for this one is just going to be Text.
01:51Let's go ahead and change the caption for second one.
01:54This one I'm going to call Line.
01:55Now you can put any kind of content that you want inside of here.
01:58Later on we're going to take a look at subforms.
02:00You can put an entire form inside of this tab.
02:02You can put all kinds of content: buttons, selectors, hyperlinks, text boxes, and charts.
02:07Anything that you can put on your form you can put inside of a tab.
02:09Now there is another control in Access 2010 called the Navigation control.
02:13This is similar to a tab, but it only works with the forms inside of it.
02:17Let me take a look at one of these.
02:18I am going to go ahead and select these tabs and delete them.
02:20We'll use the Navigation control here, the one with the pink bar at the top.
02:25I'll click and I'll drag out a Navigation control.
02:27Now the interface is a little bit unusual with the Navigation control.
02:31When I first put it in, it's selected, but nothing is showing up here in
02:33the Property Sheet.
02:34I'll click on the Add New here,
02:35I'll double-click on it, and I will change its name.
02:37For instance, I'll say Employee Directory and press Enter.
02:40When I press Enter, Access adds a little tab right here and moves over to the next one.
02:44I can add a second tab by double- clicking here and adding another name.
02:48I'm just going to call this Orders by Product and press Enter.
02:51Now I have the opportunity to add a third tab and so on.
02:53Once I go back to the first one that I created, the Property Sheet is live now.
02:56I can go ahead and change what's connected to it.
02:58So for instance I can go to the Data tab. In the Navigation Target Name it
03:02automatic shows as Employee Directory because that's what I named the tab.
03:05If I wanted to change that, I can use this dropdown menu and choose different
03:08forms that are already present in my database here.
03:11The Orders by Product tab, again, it automatically selected it, because I
03:14changed the name to that up here in the tab.
03:16But you can make the name whatever you'd like and then change the target here
03:20to whatever form you want.
03:21So let's take a look at this form in Form view.
03:23We'll click on the Form view button, and I can scroll down to see my
03:26employees directory.
03:27You change this tab here and look at the Orders by Product one.
03:30Now the Navigation controls, they're little bit hard to deal with.
03:33I honestly think the regular Tab control works much better than the Navigation
03:37tab control for this sort of object.
03:39The reason being is that the regular Tab control, you can put a form in it using
03:42a subform, like we'll see later on.
03:44So there is nothing really special about the Navigation control in these tabs.
03:47One other thing about the Navigation control: if you go to the Create tab or the
03:50Ribbon, under the Form section here, you get this whole navigation group.
03:54If I click on here, you can see a whole bunch of different forms that are preset
03:58up with the Navigation control and the tabs in different arrangements. For
04:01instance, I can select Vertical Tabs Left and that will create a new blank form,
04:05ready for me to type in the values that I want in here.
04:07So for instance, I can do the same thing.
04:09I can double-click on the tab on the left and type in Employee Directory and press Enter.
04:14Then I can add the second tab here, and this time I'll type Product Selection
04:18and press Enter again.
04:19Now if I view this form in Form view, you can see how the tabs are working a
04:23little bit better. Employee here, Product there.
04:25All it's doing is pulling in the content from these other forms and placing it
04:29inside of this navigation form.
04:31So that's a couple of ways that you can add tabs to add dimension and
04:34organization to your forms when screen space is at a premium.
04:37Later on when we take a look at subforms, we'll see how we can make a regular
04:40Tab object function almost exactly like this navigation form, and we'll have
04:44more control over it with that method.
Collapse this transcript
Adding buttons
00:01Buttons are one of the key interactive elements that you'll use on forms.
00:04They instantly tell the end user that something will happen when I click there.
00:08Buttons will be linked to either Macros or Visual Basic code to control their behavior.
00:12Like the other controls, you add them to reports as well for navigation
00:16within your database.
00:17But the nice thing about buttons is that they don't print when you print your report.
00:20Let's take a look at adding some buttons to my Controls form.
00:22I'll right-click on that form in the Navigation pane and choose Design View.
00:27The Button control is this one right here, the rectangle at the Xs inside of it.
00:30I'll go ahead and click that once and click to add a button to my form.
00:33When I do that the Command Button Wizard starts, and it asks what do I want my button to do?
00:38This first section has Categories;
00:40the second section has Actions within each category.
00:43So for instance, I've got Record Navigation, and I can do Find Next or Find
00:46Record or Go To Next Record or Last Record.
00:49Under Record Operations I can Add New Records or Delete Records, Print or Save.
00:53Under Form Operations I can apply a filter, close or open a form, I can send a
00:58form to a printer, or refresh the data.
01:00Under Report Operations I can choose to Mail a Report or Print a Report.
01:04The Application category only has one action and that's to Quit Access or quit
01:08the entire program, and finally the Miscellaneous category has things like Print
01:12a Table or run another Macro.
01:13Let's go ahead and choose one of these options.
01:15I'm going to go to Form Operations and I'm going to choose Open Form.
01:19We'll go ahead and say Next, Access then asks me well, which form do you want to open?
01:22I want to open up the Employee Directory;
01:24we'll go ahead and say Next.
01:25Access asks us if we want to open the form to a specific data or open the form
01:29and show all the records.
01:31I want to display the entire thing, go ahead and say Next.
01:33And finally, what do I want all my button?
01:35Do I want Text or do I want a Picture, and if I want a picture, I can browse and
01:38find an icon or I can accept the default here.
01:41We'll go ahead and choose Picture, and we'll accept this default one here.
01:44Let's go ahead and say Next, and we'll accept the default name for this
01:46button and say, Finish.
01:47Now I've got a button on my form.
01:49I'll go ahead and deselect it, so I can see what it looks like.
01:51Now buttons have lots of properties that we can change.
01:53For instance, I selected that I wanted an image on my button, but what if I
01:56wanted an image and text?
01:58Well, I can do that over here in the Format tab for the button.
02:01Right now it says Picture Caption Arrangement:
02:03No Picture Caption.
02:04Let's go ahead and change that to Right;
02:06that will add a caption to the right side of my image.
02:09Let's make the button a little bit bigger, I'll drag on the right side and I'll
02:11make it a little shorter.
02:14Now I can change the text here with the Caption.
02:16So instead of just the icon, I can have, say, Open Employee Directory, and
02:21again, I'll have to make it a little bigger or I can go to the Format tab and
02:24change the font, I'll make it a little smaller, to an 8 point.
02:26I can also change the font down here;
02:29Font Size is now set to 8.
02:30Let's see some other things that we can change with our buttons.
02:32I can go up to the Quick Styles button here in the Format tab and choose a style that I like.
02:36May be I want to make it look like this green light button.
02:38Now it's got a shadow and it's green colored.
02:40I can click on the button and take a look at Shape Effects.
02:43We can add Shadows or Glow, or Soft Edges, or even make it Beveled.
02:47Now I want to caution you against using some of these especial effects.
02:50A lot of times we can just add unnecessary clutter to your forms, they don't
02:53actually add anything to the user interface.
02:55And I'm going to leave all these alone and let's go back and take a look at some
02:58more properties here.
02:59Some of the other things that I can do is change the color when the
03:01user interacts with it.
03:02So for instance, I've got Hover Fore Color right now or Pressed Fore Color,
03:06the Hover state is what happens when the mouse moves over the button, the
03:09Pressed state is what happens when the user clicks down on the button, we can
03:12change both of these.
03:13Hover Fore will change the color of the text, so instead of that black color,
03:16maybe we'll make the checks change to dark gray.
03:19The Pressed Fore Color will change the color of the text when it's pressed, so
03:22instead of black, we'll make it red when it's pressed.
03:25The Hover Color and Pressed Color will be at the background of the button.
03:28So we'll set the Hover Color may be to a darker green, here, and the Pressed
03:32Color, maybe we'll make that red.
03:33I'll hit the Build button and I'll choose a nice red.
03:36Let's go ahead and see what my button looks like now.
03:37I'll go to the Home tab and switch to Form View and now if I hover over the
03:40button, you see the color has changed to a gray color.
03:43As I hover over it, it changes color and as I click down on it, it changes too.
03:47So I can see it's got a light pink background with a red text.
03:49If I click on the button;
03:50it's going to open up my Employee Directory, so it's doing exactly what I told it to do.
03:53Let's go ahead and close the Employee Directory and we'll switch back into
03:56Design View for our Controls form.
03:58Now I can control what the button is doing when I click on it from the Event
04:01tab in the Property Sheet, when we went to that wizard it was creating this
04:04OnClick event which means when I click on it what happens, that runs this in Embedded Macro.
04:08I can see what the embedded macro is by clicking the Build button to the right.
04:11Or if I have other macros that are already saved in my Navigation pane here, I
04:15can use the drop-down menu to select from those.
04:17I'll click Build to edit the Embedded Macro.
04:19When I went to the Wizard I told that I wanted to open the form, so I created
04:22this Openform event.
04:23I also told it what form I wanted to open, so it attached that here.
04:26But it didn't ask me some other options, for instance, Window Mode or Data Mode
04:30or if I wanted to apply some filtering.
04:31So these are additional options that I can choose to add into this Openform
04:34Button, for instance, Window Mode, they don't change that to dialog, in which
04:38case the Employee Directory would open up as a pop-up menu.
04:42Let's go ahead and close this and see what that looks like.
04:44I'll return to Form View, and now I'll click on the Button, and the Employee
04:47Directory opens as a pop-up menu instead.
04:49So buttons provide the main interactive interface through the Access database.
04:53They leverage Macros or Visual Basic code to perform the actions, and they're
04:56instantly recognizable for your end users.
04:58So when somebody sees a button on a form, they know that they can click on it
05:01and that will affect the database.
Collapse this transcript
Linking to external content
00:01The hyperlink and web browser controls allow your forms to reach out beyond
00:04the local database and into your computer right onto the Web, you can use the
00:08Hyperlink control to open a website or help embed online content right there
00:12inside of your database, let's take a look at how we can use Hyperlinks and
00:15web browser controls.
00:16In this Controls Forms I'll right-click and go to Design View.
00:18The Hyperlink control is this one right here with the global and the chain.
00:21I'll click on it and a Hyperlink wizard opens.
00:24I can choose to link to items within my computer, for instance, from this
00:27current folder I can scroll through and make a link to this TwoTreesCatalog
00:31file, which is a Word document.
00:33I can say OK, and Access places a link to that document right inside of my form.
00:37If I go to Form view and click on that link, Access is going to warn me about a
00:40potential security notice, because it doesn't know exactly what file this is,
00:44but let me go ahead and say Yes, and that we'll open up Word with the document
00:47inside, so I can make any changes and save it right back to my computer.
00:49Let's go ahead and close Word that will take us back to Access and I'll switch
00:53back to Design View, let's add another hyperlink control.
00:56I'll click on that and the wizards starts again.
00:58I can choose to bring in web pages or recent files that I might have used.
01:01I can make a link to other objects in the database.
01:04So for instance, I can link to a Form and it'll work the exact same way as is link to a file.
01:09I could also link to E-Mail addresses, so it can provide an easy link to e-mail
01:12the database developer, or I can go down here to Hyperlink Builder and connect
01:15directly to a website.
01:16So for instance, if I wanted to link to the Two Trees Olive Oil company
01:19website, I can just type URL right there in the address bar,
01:22http://twotreesoliveoil.com and press Enter.
01:27Access adds that link to my form as well;
01:30I'll switch to Form and try it out.
01:31It opens up my web browser and there is the Two Trees Olive Oil website, right
01:35there easily access within my form.
01:37Okay, let's close this down;
01:38let's take a look at the web browser control as well.
01:40I'll switch my view back to Design View.
01:42The web browser control is the one right next to the Hyperlink;
01:45it's this one here at the box and the globe inside.
01:47The web browser control is new in Access 2010 and I really think this is cool;
01:51I'm going to first highlight these two and get rid of them.
01:53Now I will add a web browser control right inside my form and I will drag out of
01:57box when I like over the button the Insert Hyperlink wizard starts, it asks for
02:01an Address, let's say I want to add some content from Wikipedia.
02:04First, let me go find it on the web, I'll go out to my web browser and the
02:07Wikipedia article I want to link to is here, it's this Wikipedia article on Olive Oil.
02:11Let me just highlight this address and I'll press Ctrl+C on my keyboard to copy
02:15it to the pasteboard, I'll come back down to Access.
02:17Now in the Address bar I'll press Ctrl+V to paste it in and I'll press Enter,
02:21that adds a web browser control link to the Wikipedia article.
02:25In the Format tab, I can change its size a little bit.
02:27Most web pages work pretty well with a website size of 960 pixels, so let me go
02:32ahead and just type that in.
02:32960px to specify pixels and I will press Enter and Access will resize that
02:38object, let's go ahead and change to our View menu and I'll view our form.
02:41And after just a moment, the Wikipedia article loads right there inside of my
02:45form, I can scroll through and read the entire article.
02:48So it makes it really easy to bring an external content for reference, let's
02:52take another look at this web browser control and something that I think is kind of cool.
02:55I can switch my view into Design View here and I'm going to delete the one that
02:58I put with Wikipedia, we'll add one more here and I'll just click to add that in there.
03:02Now let's say I wanted to add video content from YouTube, let me go back up to
03:05my web browser here, and if I switch to this page here, I've currently got the
03:09lynda.com YouTube channel up.
03:11Let's say I want to embed the content of this video right inside of my form.
03:15On YouTube, I'll click this Share link here and then the Embed code, this'll
03:19give the code that I need.
03:20The piece that I want is his web source right here, the http portion.
03:25Now fortunately, I can't just select that portion, so I'm going to Ctrl+C to
03:29copy the whole block of text.
03:30I'll go back into Access, and I'll paste the whole thing here in the address bar
03:33and I'll delete everything after the URL, which ends right there with the first
03:37quotation mark that I can see, I'll get rid of that and then I'll scroll this
03:41back to the beginning, and I'll get rid of everything before the http, including
03:44that first parenthesis.
03:45So that leaves me just the URL for the video, I'll press Enter and that will
03:49apply down to the box.
03:50Now let's switch into the Form view and I can see the content of the video right
03:54inside of my form, I can even play it.
03:59So bringing in content from the web can be a great way to add dynamic content to
04:03your database without having to store anything inside of it.
04:05Training or marketing documents, customer testimonial videos, specs on products
04:09and all kinds of information can be made available right within your database,
04:13so that's easy to get to when you need it.
Collapse this transcript
Entering and selecting data
00:00When it comes to displaying data in your forms there are three objects which are
00:04used most often, they are the Text Box, the Combo Box and a List Box.
00:09For this exercise we're going to create a new form based off this Reviews Table.
00:12Let me go ahead and open up the Reviews Table and you can see that this a place
00:16where you can collect information about product reviews from our customer.
00:18I've got a review identification number, product ID that's being reviewed,
00:22the rating given, any comments and whether we can use this review publicly on our website.
00:27We're going to build a form that'll add records to this table, let's go ahead
00:31and close this table, let's go to the Create tab and we're going to Create a new
00:35Form and Design view.
00:36Now the first thing I want to do when creating a new form is connect it to the
00:40table where the data is going to go.
00:41In the Property sheet for the Form, I'll go to the Data tab and I can set this
00:45Record Source here by using the drop down menu to the table I want to connect it
00:49to, in this case Table Reviews.
00:51Now I can start adding the fields that'll interact with the table, there is a
00:55couple of way I can do that if I go to Add Existing Fields here, it'll show me
00:58all the fields within that table.
01:00Go ahead and grab Comments and drag-and-drop it over, this adds a large text box to my form;
01:05I am going to move this over a little bit.
01:06Now we can do this in other way too, we can add a text box manually and
01:10connect it to our table.
01:11The text box control is up here on the ribbon it's got the ab icon.
01:15If I click that and add one to my form, it's currently unbound;
01:18it's not connected to the table.
01:20I can bind it by going back to the Property Sheet and the Control Source for
01:23this text box now, I can use the drop- down menu, and it'll ask me what field in
01:27the table to connect to.
01:28For this one I'm going to connect to the ProductID, let's go ahead and view
01:31this form in Form view.
01:33Now I can scroll through the records that are already in my Reviews Table, so
01:36for instance, if I am on record number 1 which is for this particular oil and
01:40this is the comment.
01:41I can scroll through them;
01:42there is review 2, review 3, review 4, and if I go to review 5, it's blank;
01:47this will be a new review,
01:49So if I wanted to add a new review to this Reviews Table, I will just type in
01:52the values here, but the problem with the text box is it doesn't give you much guidance.
01:56So for instance, I'm not really sure which ProductID, I know the name of it, but
02:00I don't know what its ID numbers is.
02:02So the text isn't giving me any help.
02:04We can make this a little bit better by using a List Box or a Combo Box to
02:07provide the values that I can just choose from the list.
02:09Let's switch back to Design View.
02:11I'll go to the View menu and choose Design View, let's go ahead and get rid of this text box.
02:16I'll select both it and the label and I'll press Delete, and a List Box and the
02:19Combo Box function almost identically.
02:22This right here is the Combo Box.
02:24The List Box, if I scroll down, is right here.
02:27The main difference between a Combo Box and a List Box is that a Combo Box
02:30displays one line and you can expand the box to show the list.
02:33The List Box is always expanded and has a scrolling bar on the right side to
02:37move up and down, let's go ahead and add a Combo Box.
02:39Let's scroll back up here and choose the Combo Box icon, and I'll add it into my form.
02:43When I add a Combo Box the wizard starts and it asks me a couple of questions.
02:48The first screen asks where the value is going to come from that will populate the list.
02:52We can choose to get them from another table or query, we can type in a
02:56list manually, or we can use a Combo Box actually jump to a record based
02:59off something I select.
03:01I am going to have the list populated from a table or query.
03:03Let's go ahead and say Next, the next screen is going to ask me, well,
03:06which table or query?
03:07Now let's pause here for a second.
03:09What I want to do is enter in product reviews into my Reviews Table.
03:12You might think, okay, so we need to connect this to my reviews table, right?
03:15But if I do that it's going to generate a list of products that are already in
03:19the Reviews Table in this case I only have four reviews, so I only should be
03:22able to choose from those four products.
03:24In this case I actually want a full list of all of our products to choose
03:27from, so I'm actually going to pull this from the Table Products, let's go
03:30ahead and say Next.
03:31Now which field from the products table do I want to use?
03:33I don't want to use the ID number, that was the problem we had in the first place.
03:37I want to use the Product Name, let's go ahead and select that to move that to
03:40the selected field section, and I'll press Next.
03:43We can sort this ascending or descending, I'm just going to accept the default
03:46and say Next and here is the list that's going to show up in the Combo Box,
03:49let's go ahead and say Next.
03:51The last window says, do we want to remember the values for later use or do I
03:54want to store this value in a field?
03:56We want to store the value back into the Reviews Table here.
03:58So we're going to store the values in the field and the field that I want to
04:02store it in is ProductID, go ahead and say Next, and I'll set the default
04:05name and say Finish.
04:06Okay, let's make this a little bit wider and I'm going to move it over to a line
04:10with my Comments box.
04:11Now let's go ahead and take a look at in the Form view.
04:14Now I've got a drop down list where I can select the oil from, so again, I'll go
04:17to record number 5, which is the new record, and now I can select from the list
04:21the oil that I want to review.
04:22Let's say the Light Oil and the 8oz size, I can type in my comment, this is
04:26a good size product.
04:28I'll press Enter and I'll move to a different record just to finalize those
04:31changes or I can press this Pencil icon over here to commit the change to the table.
04:36Now if I review my Table Reviews, I'll double click on it to open it.
04:39I'll see that new review right down here, I'll review the Light Oil and the 8oz
04:42size and this is the ProductID for that and this is the comment that I left.
04:46We're going to take a look at how we can use the check box and a rating
04:49system in the next movie.
04:50So that's how you would use a Combo Box.
04:52To populate a list of values that user can select from, it provides additional
04:56context over just a standard text box that allows them to type in whenever
05:00they'd like, without any sort of instruction and what to do.
05:03The Combo Box and List Box are much friendlier controls for your end users.
Collapse this transcript
Controlling input with option groups
00:01Yes/No Data Type fields have several different ways that the user can
00:04interact with them.
00:04The most common is with a Checkbox an Option Button or a Toggle Button.
00:09We can also group several of these elements together in what is called an option
00:12group to deal with more complex data entry.
00:14We are going to continue working with a simple form to capture product reviews
00:17that we created in the last movie.
00:19I will double-click to open it and we will see that we can select an oil name
00:22from this drop-down menu and entering comments here that we want to add to our Review.
00:26Let me go ahead and open up this Reviews table.
00:28I will double-click on it to open and we will see that the Reviews table also
00:31has two fields, one for Rating, here, which is the numerical value and one for Public.
00:35A Checkbox or Yes/No data type that says whether or not we can use the review on our website.
00:39I am going to go ahead and close this table down and we will change our format
00:42to Design View, here.
00:43I am going to go up to the controls up at the top and I am going to use the More
00:46button to open that Controls Panel.
00:48Now the Checkbox Control is this one right here.
00:50This one that looks like an eyeball is our Option button, and over here on the
00:53left, is our Toggle button.
00:54It's the one with the rectangle and two different states.
00:56We are going to add each of these to our form, and then connect them to the
00:59Yes/No Public box on the Reviews form.
01:02We will click on the checkbox and add one in.
01:04I will scroll down and add this Option button here, and I will add one to my
01:08form and I will scroll down and add a Toggle button, and I will put that in my form as well.
01:13When you first add these in, they are unbound.
01:16They're not connected to this Reviews table in any way.
01:18I do need to identify which field this control.
01:20I can do that in the Data tab of the Property Sheet.
01:23If it's not open, you can toggle the Proper Sheet with this button here or
01:25press Alt+Enter or F4.
01:27The Control Source field, is this the drop-down menu where I can select the
01:31field that I want to connect it to.
01:32In this case, I'm going to connect it to Public.
01:35And I'm going to connect with radio button and the checkbox to Public as well.
01:38Make sure you click on the radio button, not the label;
01:41we will go to Control Source and choose Public.
01:45Now I will click on the checkbox, Control Source and Public.
01:48So now all of three of these elements are connected to the exact same field.
01:52Let's go and take a look at our form.
01:53I will change to Form View, and I can see that this first review of 5, the
01:57checkbox is turned on.
01:58All of these are active.
02:00As I scroll through my records, record number 2, it's turned off.
02:03If I were to toggle one of them, they'll change state at the same time.
02:06That's because they are connected to all, the exact same field in this table.
02:09Okay, let's go back in the Design View.
02:12I am going to go ahead and get rid of two of these, and the checkbox is the most
02:16common option that people are familiar with, so I am actually going to get rid
02:19of these other two interface elements.
02:20We are just going to stick with the checkbox.
02:21I'm going to change the label for this checkbox to, May we use your comments on the website.
02:26I will double-click to edit it and I will move this up below the comments box.
02:32Now I want to add a control, so that they can enter any product rating.
02:36I could just have type in a value, but some people will type in five stars or
02:40three or some other random numbers, so I won't be able to control this a little bit more.
02:44What I can do is use what's called an Option Group.
02:46Up here in the Control section, the Option Group is this one here with the white
02:50rectangle on the XYZ across the top.
02:51I will click that on, and I will just add an Option Group down here.
02:55When I do that, the wizard starts.
02:56The first thing that it wants to know is what are the labels?
02:59These are going to be what the end user sees.
03:01So I want to make sure that they are clear.
03:02I'm going to put in the five selections that I want them to choose from.
03:05The first one is going to be Excellent followed by Good then Average, then Below
03:09Average and then Poor.
03:11Once I get those five labels typed in, I will go ahead and say Next.
03:14The next screen asks if I want to make a default choice.
03:16Now I don't want to skew my results at all, so I am going to say no, I don't
03:19want to default choice.
03:20Go ahead and say Next.
03:21And then it wants to know what values do I want to associate with the label?
03:24So again, the users are going to see what it says on the label.
03:27The value is what's going to be saved in my data table.
03:29I am actually going to want to reverse these numbers, Excellent is going to be
03:32a 5 rating, Good will be a 4 rating, Average is 3, Below Average is 2 and Poor is 1.
03:38Go ahead and say Next.
03:39The last screen is going to ask, do I want to save the value for later use or
03:42store the value in a field.
03:43So we are connecting this to our Reviews table, so I want to store this in a
03:46field and I'm going to connect it to my Ratings field.
03:49Go ahead and say Next.
03:50We have a choice of how we want this to display;
03:52we can either choose an Option button, a Checkbox or a Toggle button.
03:56Now in standard User Interface practices, checkboxes typically mean that
03:59the user can select multiple options or as an Option button, they can only check one.
04:03So in this instance, I would probably avoid the checkbox.
04:06I would either choose the Option button, or the Toggle button.
04:08In this case, I'm going to choose the Option button.
04:10We can also add a style to the line around the edge here.
04:12You can either leave it Etched, Flat, Raised, Sunken or Shadowed, let's go
04:18ahead and say Next.
04:19Finally, it's going to ask what do I want to name this.
04:21This is the title that's going to appear here.
04:23Instead of Frame10, I'm going to choose Rating and say Finish.
04:26That adds the Option button group to my form.
04:28Let's go ahead and rearrange the elements a little bit.
04:30I can highlight everything up here.
04:32And select them this way and I'll Shift+Click just like those labels.
04:38I'm going to move that up to the top, then I will move all of the rating stuff
04:41over to the right side.
04:42Finally, I am going to make my form a little bit shorter, so I will scroll at the bottom.
04:45I will drag this back up to the top and I am going to change the labels here,
04:50instead of Combo3, this is going to be Product.
04:53Now I can move these over to align them up a little bit, I will use these
04:56handles in the top left, drag them over and we will drop them there.
05:00Finally, I'm going to right align the text, so that all the labels are aligned together.
05:04We will go in the Format tab, and say right aligned.
05:06Okay, let's check out our form, we will go back to Home tab, switch to Form
05:09View, and there is our finished form.
05:11I can see that the first review is for this particular oil.
05:13This is the comment, it's public and they gave it a rating of Good.
05:16I can scroll through the different reviews or I can add my own.
05:19We will go to the next blank one, choose a product to review, about the Mission Oil.
05:24They can use it on the website, we will give it a good rating and we can type in any comments.
05:28We will click this pencil icon to finish the review and we can double-check the
05:32table to make sure that it got entered.
05:34And it looks like all the values came in.
05:35So the Option Group gave us a good way to translate what we want to store in
05:39the database, this numerical rating, to a different sort of tag that's
05:42presentable to our end users.
05:43So we were able to use a Checkbox and Option button or Toggle button, to
05:48interface with the Yes/No Public field here.
05:50And we used a Control group to translate the numerical value that we wanted to
05:54store on our database, to something that's a little more user-friendly to our
05:56end-users, the text tag, of what their rating is.
Collapse this transcript
Attaching documents
00:01There is plenty of debate on whether you should actually attach files such as
00:04images or Word documents to records within your database.
00:08Some people claim that it leads to database bloat and slowdowns.
00:11The Hyperlink option is definitely a good way to include links to additional
00:14resources without actually embedding everything within the Access Database file itself.
00:19But when you do have tables such as our Employees table here if I right click
00:22on that and go into Design View that have the Attachment and OLE objects field,
00:27let's scroll down here, I have got fields here, one of Attachment and one of the OLE Object.
00:32If you do use these two data types you will need to know how to actually make
00:35use of them in your forms.
00:36Now in this table we are using Attachment data type to store photos of our
00:40employees and I've also got this other field here called OLE that's using the
00:44OLE object attachment.
00:45Now the OLE object is kind of an older and somewhat more obsolete data type and
00:50it's basically just kept around for backwards compatibility.
00:53Now if you are not already using it, the OLE object data type is kind of an
00:57older and somewhat obsolete format.
01:00If you are going to attach files to your database, you should probably be using
01:03the attachment data type.
01:04But, since we have them both here, let's take a look at how we can work
01:07with them in our forms.
01:08I will go ahead and close this table.
01:09I am going to create a new form in Design View by going to Create tab and Form Design.
01:13Now I am going to attach those forms to my Employees table by going to the
01:17Data tab, the Record Source property, I will use the drop-down menu here and
01:20select tbl_Employees.
01:22Then I will go to my Add Existing Fields panel, I will click on the button here to open that.
01:26This shows me all of the fields that are in my Employees table.
01:28I am going to go and double click on the Photo field here and that will add it
01:32to my form, and I will also double click on the OLE field here to add that to my form as well.
01:37Now these two objects are bound to my table here, I can also add these fields
01:40manually up here in the Control section, let me go ahead and open this up here.
01:44The Attachment field is this one right here, it's the paperclip.
01:47If I click on that and I click down here in my form, it'll add an
01:49unbound attachment.
01:50At this point I can go into the Property sheet and attach it to a field if I wanted to.
01:54I could also go up here to the More button and I actually have two different
01:56ways that I can embed in OLE object.
01:58I have got this one here with a cactus and the XYZ;
02:01this will add a bound reference to something in my tables.
02:04So for instance this OLE field in my Employees table.
02:06I can also have an unbound OLE object, which will be this icon right here.
02:10Let me go ahead and add one of those to my form as well.
02:12I will click on it and then I'll click down here to edit.
02:14When I do that, since it's unbound to a data table, it wants to store the object
02:18right here inside of the form.
02:19Access displays a little pop-up window that asks me, how do want to create a file.
02:23I can either create a new file right here inside of the form, or I can select
02:27a file by selecting the Create From file, and browse to something on my hard drive.
02:30For instance, I will go to Browse and I will go to my Exercise Folder on
02:33the Desktop, Chapter 3.
02:34I will scroll to the bottom here and I'll add this to TwoTreesSalesPresentation,
02:39which is a PowerPoint file.
02:40I will go ahead and press OK and then OK again.
02:43That will add that into my form, and you will see an image of that pop right up.
02:47Let's go ahead and take a look at our form and we will see what these
02:49objects look like there.
02:50I will switch into Form view.
02:52Now these objects are a little bit haphazard on the screen here, but this one
02:56right here, this is our photo attachment that's pulling the photo directly from
02:59our employees table.
03:00If I double-click on it, I can bring up the Attachments window or I can play
03:03with the attachments that are attached to it.
03:05Now the attachments field allows you to attach multiple files, so right now I
03:08just have this one image, but I can add multiple documents here, I can say Add,
03:13back into my Exercise Files, Chapter3 folder and I will scroll down and may be I
03:17want to attach a catalog to this record.
03:18I will click on the TwoTreesCatalog file, which is a Word document, and say Open.
03:23That adds it to the Attachments panel, and I can say OK.
03:25Now that I have attached this file, I will press this Pencil button right up
03:29here to finalize that into the table and I will double check my tbl_Employees
03:33here, I will double-click on it, and if I scroll to the right, we will see that
03:37I have now two attachments with the specific employee.
03:40The Word document is tied directly to this employee;
03:43let me go ahead and close this table.
03:44We will go back to our form here.
03:46Now I can also attach OLE objects, it's kind of a similar operation,
03:49double-click on the box Access tells me that the OLE object is empty, and I
03:53can't edit it until I add one, and it tells me how to add one as well.
03:56It says I need to right-click on the field and then click Insert object.
04:00We will go ahead and say OK.
04:01This time I will right-click, go down to Insert Object and Access brings up a
04:05dialog box that we have seen already.
04:06I can create a new object or I can select one from a file.
04:09Now creating a new object is kind of a strange procedure here, for instance, I
04:12will select this bitmap image and I will go ahead and say OK.
04:15The OLE object opens it inside of its own window, I can do whatever I would like
04:19in here, for instance, I will just scribble something.
04:21And I will go ahead and close it.
04:22Access saves that into my OLE field.
04:24If I wanted to get rid of that now, I could right-click on it and say Delete.
04:28If I right-click and say Insert object, I can add different objects, I have a
04:32whole list here, some of these work better than others.
04:34If I scroll down here for instance to Microsoft Excel worksheet, I could say OK.
04:38Access opens up a Microsoft Excel editing session, the problem with it is, it's
04:42right here, it's very tiny it's the size of the box that I drew out on my form,
04:46I can't really resize it, it looks like I can, but it doesn't really resize.
04:50Also it says I am still here inside of Access, but now I've got windows here
04:53that are from Excel, So it's kind of a strange editing environment.
04:57If I wanted to get out of here, I will just click off this box anywhere.
04:59I will click over here on the side and that will take me back to my form, and
05:03you can see I have got these really tiny, little teeny Excel file kind of
05:06embedded right in here.
05:07Now I don't know of any way that I could actually make use of that.
05:10The attachment field is a much better option, in fact, if you click on it once
05:13you will get a little menu up here that allows you to scroll through the
05:16different attachments.
05:17So for instance, for my first record I have a photo, but I also attach this
05:19Word document, so if I press the arrow over to the right, I can get access to the Word document.
05:23If I double click on it now, it brings up this attachments window again, and I
05:26can say TwoTreesCatalogDoc open, and it will open up that file right in Word.
05:31I can make whatever changes I want, for instance, if I put Olive Oil and change
05:36the font size, save my changes here, and then close the window.
05:43Now when I come back to Access, I say OK, and Access recognizes that I made
05:46changes to that file.
05:48It asks me if I want to update the version that's inside the database.
05:50I go and said Yes and that will update those changes into this Word document
05:54that's stored inside of the database file.
05:56The PowerPoint presentation that we added to the OLE field works similarly, but
06:00by default its ability to edit it directly here is disabled.
06:04If I go into the View menu and go into Design View, I will take a look at the
06:07Properties for this down here.
06:08I will go to the Property sheet and right down here, where it says Enabled, No,
06:12that means that I can't double click on it to edit it.
06:14If I change its property to Yes, and then switch back to Form view, now I can
06:18double-click on it to open it up in PowerPoint, I will press Esc to get out of that.
06:22So the OLE data type really does kind of duplicate functionality that we have
06:25with the attachment data type, and because OLE objects are kind of at this point
06:30a legacy feature that's really only kept around for backwards compatibility
06:33reasons, I really wouldn't recommend using it if you don't have to.
06:36If you must save files into your database, then use the newer attach file type
06:40and will be placed on a form, images display with the rest of your data, just
06:43like this photo here, and you can scroll through to get additional documents
06:46that are attached in a single field.
Collapse this transcript
Attaching images
00:01The selective use of images throughout your database can accomplish several tasks.
00:05They can help your documents conform to company branding standards or reinforce
00:08organizational pride.
00:10They can also make your database more attractive and give it a bit of
00:12personality, may be even make a fun or inspirational for your end-users.
00:16Now there are four different ways that we can add unbound images to your forms and reports.
00:20And when I say unbound, I mean not connected to a data source like our employees
00:23photos were in the last movie.
00:24I am going to go ahead and go to this Controls Form, and I will right-click on
00:27it to open it in Design View.
00:30On the Controls part of the ribbon, we will scroll down and we can find
00:33the Image control here.
00:34It's one of the mountain and the sun icon.
00:36We can also insert images using this button here on the right.
00:39When we use this button, Access creates a little gallery of images that we
00:42have used previously.
00:44So we would save the file here, so I could easily get to it again.
00:47Another way we can add an image is using the Logo button which is this button right here.
00:51When you use the Logo button, Access automatically formats it and sits it in the
00:55header as a logo, and makes a small little icon and it puts it in the header of
00:58your form or report.
00:59The fourth way we can add an image, is if you go to the Format tab, we have this
01:02Background Image here.
01:03When you use the Background Image button, Access places an image into the
01:06background of the form.
01:08Let's go ahead and go back to the Design tab and we will add an image using
01:12the Image control here.
01:13I will click on it once, and I get my icon here that changes to a little cursor
01:16with the image icon, and I will drag out a box where I want my image.
01:19I can always change to the box later.
01:20Let's go ahead and go to our Desktop in our Exercise Files, Chapter 3 and we
01:24will choose this OlivesOnBranch.
01:25Go ahead and say OK.
01:28Access places the image inside of the bounding box that I selected.
01:31Let me go to the Format tab of the Property Sheet.
01:33And if your Property Sheet is not opened, you can press F4, Alt+Enter
01:36double-click on the Image control or press the button on the Property Sheet.
01:39Go to the Format tab for the Image.
01:40Now there are a couple of properties that I want to take a look at here.
01:43The first one is this Size Mode one and it's set to Zoom.
01:45With the Size Mode set to Zoom, Access makes the pictures as big as it can,
01:49without distorting it inside of the bounding box.
01:51For instance, if I change the bounding box to make it narrow, Access fits the
01:55image inside of that new bounding box.
01:56I will go ahead and make it bigger again.
01:58If I change the Size Mode here from Zoom to one of the other options, for
02:02instance, Clip, Access puts the image in at full size or a 100% resolution and
02:07uses the bounding box as sort of a clipping border.
02:09I can change the alignment, right now we are looking at the center of the image
02:12here, Picture Alignment Center.
02:14I can change where this image starts in my bounding box, for instance, I can say
02:17Top Left, and we will the top left of the image, or Bottom Right and we will see
02:21the bottom right image.
02:22So I can move the image inside of the bounding box with the Clip Mode.
02:25I will go ahead and set this back to Center.
02:26Here the Size Mode I want to look at here is Stretch.
02:30The Stretch Size Mode distorts the image inside of the bounding box.
02:33For instance, if I make it really narrow, you can see that it's squashes the image down.
02:36If I make it tall and skinny, it squishes at the other way.
02:39I will make it back out here I will change it back to Zoom.
02:43In the Property Sheet we can also see that this image is Embedded right now.
02:46We can see Picture Type, Embedded.
02:47That means that when we added this image, Access actually put a copy of it
02:51inside of our database.
02:52We can add links to images instead of embedding everything.
02:54And we can do that by going to the Image Control here, clicking on it, drawing
02:58a box that we wanted, when the Insert Picture dialog box opens, go ahead and just say Cancel.
03:03Access leaves the Image control on the form, but it's not attached anything
03:06here, if I look in the Property Sheet.
03:08I can change the Picture Type now to Linked, and the Picture Property here where
03:12it says none, I will click the Build button here to add the picture.
03:16The Insert Picture dialog box opens again, and I will choose the same one,
03:19OlivesOnBranch and say OK.
03:21Now I have got a second instance of this image.
03:23You can see that the picture source is linked to my hard drive.
03:26Now the problem with this is if I move my database or move the image, then you
03:30can break the link to this image and it would disappear from my database.
03:33The embedded image here would follow the database around but it adds file
03:37size to the database.
03:38So as a decision, you have to make on how best to proceed when you are using
03:41images in your database, whether you want to attach them to the file or link to
03:44them on your computer.
03:45Let me go ahead and get rid of both of these and we will take a look at another image.
03:48I will click on the first one and press delete and I will click on the second
03:50one and press delete.
03:51Let's add one more image here;
03:53I am going to scroll down.
03:53I'll click on Image Control and I will just click once to add an image.
03:57This time I am going to choose this tile one, I will press OK, and it adds that into my form.
04:02Now I can turn on Picture Tiling right here in the Property Sheet, currently
04:05it's to no and I can change that to Yes.
04:07I will also change to this Size Mode here from Zoom to Clip.
04:11Now when I resize the bounding box, Access tiles multiple copies of the image
04:15across to fill up the space.
04:17I can go ahead and position this image here, for instance, in the top corner
04:20here and stretch it across my form, to add kind of an interesting border affect to the top.
04:24Let's take a look at it in the Form View.
04:25I will click on Form View and I will see my border here.
04:27Now let me show you how we compare the image control with the attachment
04:31feature, so we can stretch this dynamically dependent on the size of the
04:34computer that the end user is using.
04:36If I go back to the View menu and switch in to Design View, with my image
04:39selected, I will go to the Arrange tab, and the Anchoring here, I will
04:43say Stretch Across Top.
04:44This will dynamically stretch it to whatever size monitor my end-users are using.
04:47Okay we will go back to the Home tab, switch to Form View and now it fills up
04:51the entire space all the way across.
04:53So these are just a few ways that you can use graphics inside of your forms and
04:57report designs, adding graphics when done tastefully and especially when it aids
05:01legibility, it can take a drab and grey collection of buttons and tables and
05:05turn it into an engaging tool for your end-users.
Collapse this transcript
Understanding the subform control
00:00Subform controls allow you to create linked table like displays of information
00:05that are related to a main topic.
00:06We saw an example of a subform briefly at the beginning of this course when
00:10we used the form wizard to display a list of all of the orders that included
00:14a specific product.
00:15Let's now duplicate that form manually using the subform control.
00:18I'm going to go to the Create tab or the ribbon, and we will create a New Form
00:21in Design View here.
00:23The first thing that we want to do is link this to the table that we want to be the main topic.
00:27In this case, we want to have a form that displays products at the top and then
00:31down below, will list a table with all of the orders that included that product.
00:34I will go to my Add Existing Fields here, I will Show All Tables and for my
00:38Products table I will expand it here, I will double-click on ProductID and
00:42double-click on ProductName.
00:44That'll add both of those fields to my form.
00:46I will go ahead and make this wider, because I know that my ProductNames are
00:49fairly long, and I am going to highlight both of these and I am going to push
00:52them up to the top with the arrow keys, okay.
00:53Let's go ahead and close the Field List here and I'm going to scroll down to
00:57the bottom of my form and make it a little shorter, so that it all fits on the screen.
01:01So Subform tool takes up a lot of real estate, which makes it a great and ideal
01:05opportunity to make use of a Tab Control.
01:07The Tab Control if you remember is right here, I will click on it in the Control
01:10section of the Design tab and I will drag out a Tab Control, like that.
01:15Access places two tabs here.
01:17In the first tab I'm going to place my Subform, so I will click here to select
01:20the Tab and then I will find my Subform, I will use the down arrow or the more
01:24button, and the Subform button is this one right there.
01:26I will click on Subform and come down into my tab, well, it turns black.
01:30The next thing I am going to do is go inside of this tab, so I will drag out the
01:33area that I want my Subform.
01:34There, and the wizard starts.
01:36And the first page of the wizard is going to ask us where is our data coming from?
01:38Do you want to use an existing Table and Query or Do you want to use an existing form?
01:42Let's go ahead and use an existing Table and Query, we will go ahead and say Next.
01:45We are going to build a table that displays order information for the product
01:49that we selected on the main part of the form.
01:51I will switch my table here, to the orders table and from there I will choose
01:55the OrderID and the ProductID.
01:57We also want to find out who ordered this product?
01:59So I will go back up here and I will choose my Direct Customers table.
02:02And I will choose First Name and Last Name.
02:04Let's go ahead and say Next.
02:05Access then asks how does that data in the subform relate to the data in the
02:09main part of the form up here?
02:10We can either Choose from the list or Define my own relationship.
02:13Now because we've already have a relationship that's been established in this
02:16database, Access has already correctly identified how they relate.
02:20So I will just take that and go ahead and say Next.
02:22We can go ahead and name our Subform, it's going to appear down here at the
02:25Navigation Pane, or we can just accept the default.
02:27I will just leave as it is and say Finish.
02:29Access adds in the subform into our tab, now we can add another form into the
02:32second tab here, for instance, I will switch to this one that says Page4 and we
02:36will go up and add another subform down here.
02:37I will click the down arrow, the Subform tool, and I will just click, to put in there.
02:42This time instead of building a new table, we will use an existing form.
02:45I am going to choose the Reviews form.
02:47This is the one that has product reviews.
02:48I will go ahead and say Next, Access again asks me, well how does this relate
02:52to what I have selected up in the main section, and it's correctly identified that relationship.
02:56So I will go ahead and say Next again, and we will just accept the default and say Finish.
03:00Access places that in my tab as well.
03:01Now let's go ahead and rearrange these a little bit.
03:03First of all I'm going to rename the tabs up here, so I don't need labels inside here.
03:07So I am going to go ahead and delete the label and then I will select the form,
03:10and I will resize it, so it fits inside the tab better.
03:13Next I will go to the other tab;
03:14I will do the same thing.
03:16I will delete the label and I will move this into position.
03:20Finally, I want to rename these tabs.
03:21And I can do that in the Property Sheet.
03:23I will select the tab, and the Caption property here, on this first one I'm
03:27going to put Orders.
03:28I will press Enter and I will go to the next tab.
03:31And here the Caption will be Reviews and I will press Enter again.
03:34Okay, let's go back into our form and see how those all are working.
03:37We will switch it to Form View.
03:38Right now I am on my first product of 90.
03:40I can scroll to the different products that we have, as I do so I get an updated
03:45table here that shows me all of the Orders that has been placed for that
03:48specific product, and if I go to the Reviews tab, I can see reviews that might
03:52have been made on this product.
03:53So now I have an easy way to review lots of information about a specific
03:57product, all in one simple form.
03:59The subform object brings in yet another way to view your content by displaying
04:02information that is related to a single record.
04:05Pairing the subform with the tab control also allowed us to keep related
04:08information together in one space efficient location, so that it is easy to
04:11get to.
Collapse this transcript
Adding charts
00:00The Chart control can give insight into your businesses metrics by presenting a
00:04dynamic graphical view of your data that changes as your database grows.
00:08Unlike exporting data to Excel and graphing there, creating your graphs
00:12directly within Access maintains the live and always updated link to your data
00:17tables and queries.
00:18Further, pairing a chart with a query gives you all the flexibility of adding
00:22query criteria to instantly refine the chart's dataset.
00:26In this movie we are going to create a chart object and in the next movie we are
00:29going to bring this chapter full circle and incorporate some other Form controls
00:33that will take user input to alter the chart's parameters.
00:36First let's create a query that collects the data that we want to use in our chart.
00:39I will go to the Create tab and we will use the Query Design view.
00:43This will be a pretty simple query we are going to take a charge that takes
00:46a look at orders over time, we will use the Orders Table and say Add and then close.
00:51From the Orders Table I want information on the OrderID and OrderDate.
00:55Let's go head and save this query now, I'll close it and in the Save window and I say Yes.
01:00I am going to name this the qry_ OrderDates, I will press OK and it saved my
01:04query to my database.
01:05Now let's make a chart off of that data, I will go to the Create tab again and
01:09this time we will do a new form in Design view.
01:10I am going to go ahead and close the Property Sheet and I am going to expand my
01:14Form area wider a little bit, to about the 10 inch mark and I am going to scroll
01:18down and make it a little shorter.
01:20Okay, so now the chart object is this control right here, it's shown with
01:25a three bars on it.
01:26I will click on it and then I will drag out a window where I want my chart,
01:29the chart Wizard starts up and it asks me which table or query do I want to
01:32use as the data source.
01:34I can choose from the tables that are my database, or I can switch my View to
01:37Queries here to select from the queries.
01:39There is the query we just built, so I will go ahead and say Next.
01:42And then which fields do I want to add from the query into my chart.
01:45We will take both of them, so I will use the double arrow to move everything.
01:48Go ahead and say Next.
01:49This screen is asking us what type of chart we want to use, there are lots of
01:52different options here and a lot of these will work better for some data types than others.
01:56I am going to choose this basic line chart here.
01:58Go ahead and say Next and now we get a layout how our fields lay on the chart.
02:03Access tries to help us out a lot, but usually it gets this part wrong here, so
02:06I like to just take these fields and drag them off of the drop zones and just
02:10start with a fresh slate.
02:11So I'll drag both of these back off, that resets the chart area, and now I can
02:14set it up the way I wanted instead of the way Access thinks I want it.
02:17I am going to take my OrderDates and put them on the x-axis on the bottom.
02:20I will just click OrderDate and drag it to down here and drop it down.
02:23When I do that Access automatically groups them by month if I wanted a different
02:27grouping level, I can double- click on it and choose it from here.
02:30So I could choose to Group by Year or Quarter or even Hour if I want.
02:33I am going to accept the default Month and say OK.
02:36The OrderID is going to go into the Data section here on the top left.
02:39When I drop it there, Access is going to aggregate based off of the account.
02:42Now if had numerical values, I could do sum or average as well.
02:46But since this isn't a numerical value, it's just going to count them up, and if
02:49I try and double-click on it to change it, it's going to tell me that.
02:51Go ahead and say OK, let's go ahead and say Next.
02:55We can now give our chart a title, and I am going to name it Orders by Month, we
02:59could either choose to display a legend or not to display a legend, and I will
03:02just leave it on, and we will say Finish.
03:04That will put us back into our form, it's had the chart object inserted here,
03:08but this image that pops up actually has nothing to do with the data we just
03:11selected, it's just a placeholder image at this point, so don't get confused
03:14with these east and west and north.
03:15Let's go into Form view and take a look at the chart as it renders, we will
03:18switch our view to Form view.
03:20And occasionally in Access, the chart doesn't pop up, if it doesn't show up
03:23automatically you might have to press the Refresh button up here.
03:26So there's a basic chart object and at this point it's pretty ugly, needs a lot
03:29of work in order to get it to work properly.
03:32If charting is something that is very important to your organization, then I
03:35would recommend looking into some of the third-party charting add-ins that are
03:38available for Access.
03:39For now though, let's see what some of the capabilities are with the built-in charts.
03:43So let's go ahead and edit this chart contents, I will double-click on it to
03:46open it up in the chart editing session.
03:48I am going to go ahead and close the datasheet, because I don't need to see what the data is.
03:52Now working with the charts is a little bit wonky, it's an older object within
03:55Access, and it's a feature that really hasn't been updated in several versions
03:59of the program, so it is going to be a little bit tricky to start getting these
04:02into the right size.
04:03For instance, the fonts that I have here are really large, compared to the chart
04:06area up above, which makes the data illegible.
04:09But if I double-click on the text here, for instance, if I double-click on word
04:12September and go to the Font section, I will see that Access is trying to tell
04:15me that this is an 8 point font.
04:16The problem is it looks like its way too large to actually be in 8 point font.
04:20Let me go ahead and say OK.
04:20The issue with the chart here is that we are actually really zoomed into this
04:24chart, and in order to zoom out, we actually need to make the chart area bigger,
04:28so that Access will try and refit it back on to the screen.
04:31Let me show you what I mean, if I drag the width here, over here to the right,
04:34Access resizes the chart and it updates the size a little bit, let me drag it a
04:38little wider again, and it makes it smaller again.
04:40Now this is going to take a little work and you might have to redo your charts
04:44a couple times until you get the hang of this, like I said, it's kind of a
04:47goofy user interface.
04:48Maybe I will make this a little wider now.
04:51And once I get the chart area looking a little bit like I wanted, for instance,
04:54now I could actually see the data, I could double click on the text again and
04:58now Access is telling me that the font is a lot bigger.
05:00At this point I can change it back to a smaller size, maybe 8 now, and say OK and it updates.
05:05Now that's looking a little too small, so I will change it straight 10.
05:09That's a better size, but now they are angled, double click on it again and
05:12this time we will go to Alignment and it's telling me that Access is trying to
05:15make it horizontal, let's force it to angled and then double click on it again,
05:19try horizontal again. There we go.
05:21We finally got into a position that looks good, let's go ahead and double click
05:24here to change in size on the y-axis;
05:26I will go to the Font and change that to 10 as well, say OK.
05:30So I am starting to get a chart that looks a lot better, I am going to take
05:33this legend here, and I will click on it once, and I am going to drag it up,
05:36get it out of the way.
05:37And then if I click on the chart area anywhere between two bars in this
05:40white area, I will select the background of the chart, and I can make it
05:43bigger to fill up the space.
05:44Finally let me change the color here, these black bars in the background I think
05:47are really distracting from the actual data.
05:49I am going to double-click on the bar to change its color, here the color is set
05:53Automatic, and I am going to choose this light Gray-25%.
05:55I will say OK and there it goes.
05:58It looks like it has lots more receded into the background and it really makes
06:01me focus on the data more.
06:02Now before we start editing this chart, now there is one more thing I want
06:05to add to this chart.
06:05If I go up to Chart menu I can choose that I want to add a Trendline here, when
06:09I click on that, the Add Trendline window opens and it asks me what type of line
06:12I would like to create.
06:13Some regression types or trendlines will fit some datasets better than others.
06:17For now I am just going to choose this linear regression type and say OK.
06:21And Access adds the Trendline into my chart and I can see that unfortunately we
06:25have got a downward trend in our orders.
06:27Let's go ahead and click off of our chart anywhere in this white space out on
06:29the outside, and then I will return this back to our form.
06:32Let's go ahead and take a look at how this form is looking in Form View.
06:34I will change my view here to Form View and Access displays that chart, looks
06:38like we have a little bit of graphic issue here, we need to resize it a little bit.
06:41So, one more time, into Design View and I'll click on the chart area and I will
06:46make it a little bit bigger, that should fit better.
06:48Okay, go back to Form View and there is our chart.
06:51The chart object allows us to better visualize patterns that might be hidden in
06:55our data and adding in trend analysis and forecasting abilities can help you see
06:59a bigger picture of where you've been and where you're going.
07:01Now in the next movie we are going to take this chart one step further.
07:04and incorporate some of the other controls to help us make this chart even
07:07more flexible.
Collapse this transcript
Linking controls
00:00Now that we have seen all of the controls that we have at our disposal when
00:03creating forms and reports.
00:05Let's bring this full circle and piece a couple of them together to control the
00:08chart that we created in last movie.
00:10So in the last movie we ended up with this chart here, I am going to
00:12double-click on it to open it, and we see that's a graph of Orders by Month.
00:16And right now it can see all of the data for my entire database, all the way
00:19from January 05 through July 2010.
00:22That data is coming from this query here;
00:23I'll double-click on the query to run it.
00:25This is the data that is getting fed into the chart.
00:27If I switch this query in to Design View using the button up here, Design View,
00:31I can see how the query was created.
00:33Now what we can do in order to modify, with the data that gets put into the
00:36chart, is I can add a criteria here, for instance, I can select a date range.
00:40For instance, in this criteria under OrderDate, if I type in >1/1/2009, Enter.
00:47Now rerun the query, it gives me a different dataset.
00:50Now I only have 598 records instead of 2200.
00:53If I go back to my chart and refresh it, actually I need to save the query, so I
00:58will go back to query, press Ctrl+S to save it, then go to the chart and refresh
01:02it, I will see a different chart.
01:04It's only reporting the data now based off of that new criteria.
01:07But what we can do is create a form that will update this criteria in the query
01:10here, if I go back to Design View.
01:12It will update this criteria dynamically based off user selections that they
01:17can type in themselves.
01:18So let's go ahead and create that form to capture the user intent.
01:20I will go to the Create tab and we will create a new Form in Design View.
01:24We first need a place to capture data, we could use a text box here and have
01:28the end-user type in the values, but that really doesn't give them much
01:31direction, for instance, the end-user is not going to know what data is
01:35available, they are not going to know what the beginning date is, what the end
01:38date is for our database.
01:39So Combo Box is a much better choice.
01:41The Combo Box will allow them to choose a date from a list of possible values
01:45that we definitely know up here in the database.
01:47The Combo Box is this one right here, I will click on it once and I will add one into my form.
01:52The Combo box Wizard starts up and I am going to tell you upfront that we are
01:55actually not going to use the results of this wizard, but I want to go
01:58through the wizard a little bit, so I can't show you why this isn't going to work for us.
02:01We will go ahead accept the first selection here to get the values from another
02:05table or query, we will say Next.
02:07The dates in our database are coming from the Orders table.
02:09So I will select that here and say Next, and here's the Date field, the
02:13OrderDate, and I will add that over to my selected fields, go ahead and say
02:17Next, we will leave the default sorting, go ahead and say Next.
02:21Now we can see why this isn't going to work for us.
02:23In our Orders table we have multiple orders on the same day, for instance I
02:26have two orders on the 10th of January 2005, and three orders on the 12th of January 2005.
02:32If I leave it this way, Access is going to display a list with all of these
02:35duplicate values in it.
02:36I just want each day to show up one time.
02:38So let's go ahead and say Cancel to back out of the wizard and not use any of this.
02:42And now we will set the data source for ourselves.
02:44In the Property Sheet -- and I can open that with the F4 key or Alt+Enter or
02:47this button here, I'll take a look at the data tab.
02:50So the row source here is currently blank, the row source is what we will
02:54populate in the list in our Combo Box.
02:56I can build a query manually using the Build button here and I will click on
03:00that and the Query session opens.
03:02Now we could choose to pull data from our Orders Table and I will Add and then Close.
03:07And I will add our OrderDates here.
03:09Now we will turn on our Totals row to group to like values together.
03:12So when I click on Totals up here in the ribbon, that adds this Group By section
03:15here, so all the dates that are same will collapse into each other.
03:18I will say Run, and now I get only each date represented one time in my table.
03:23So let's go ahead and close this, we will save our changes and then I will take
03:27a look at my form to make sure that I am getting the results that I expect.
03:29I will make it a little wider first and then we will switch our view to Form View.
03:33Now I have got a Combo Box here and when I select the down arrow, I get all the
03:36dates that are present in the orders table.
03:38Okay, let's go back to Design View.
03:39Now what I would like to do is create a selection box where the end user is
03:44going to type in a start date and an end date for the graph that they would like to see.
03:48So I am going to need two of these Combo Boxes.
03:50What I could do is highlight both of these the label and the combo box, I will
03:54press Ctrl+C on my keyboard and then Ctrl+V to paste, to copy.
03:57Next let's go ahead and name these, I am going to double click on the first
04:00label here and type in Start Date and then press Enter.
04:04And I am going to double-click on the second one and type in End Date, and press Enter.
04:09I can move these over a little bit I'll use the handle in the upper left hand
04:13corner to drag this one over and I can align both of them together to make sure
04:17they're aligned by highlighting both of them and going to the Arrange tab, Align to Right.
04:23Now I want to right align the text to make sure that's flush against this edge.
04:26We will go to the Format tab and press the right align button.
04:29Next I need to name both of these boxes here where the users are going to
04:32make their selection.
04:33Once they're named I can reference those names over here in our query.
04:37Let me click on the first box here and I am going to go to the Other tab.
04:40The name right now is Combo0, and I am going to change that to startdate, all
04:44one word, and press Enter.
04:45Then I am going to go to second box here, and I am going to changes its name to
04:49enddate all one word and then press Enter.
04:52Now my form is almost complete, I do need to add a button to open up the chart.
04:56I will switch to the Design tab;
04:57I will click on my Button button, and I will add a button down here.
05:01The wizard will start, I am going to go Form operations, open a form and say Next.
05:06The form that I want to open;
05:07that's the chart form, go ahead and say Next.
05:09Where we want to display on the button?
05:11I can either have the picture or a text, instead of Open Form, it's a little bit
05:15confusing for my end users, I think View Graph is a better option, and we will
05:18go ahead and say Next.
05:19We well accept the default name and say Finish and now I have got my button here
05:23and I will just go ahead and move it in a position.
05:25Okay, let's switch in the Form View, I can test my functionality, okay, I could
05:29see all the dates there, and I can see dates there.
05:32Go ahead and save our form here, so I will press Ctrl+S to save it, and I am
05:36going to name this GraphDateRange and then press OK.
05:38Now we just need to hook to our query into the selections that the
05:41end-users will make here.
05:42I will go to my query and in the criteria I have currently got this >1/1/2009
05:47typed in, I am going to highlight all of that and press the Delete key and
05:50then I will right-click to open up my Expression builder, I will go to the Build option.
05:54Now I just need to write in the expression that I want.
05:56And for my Date range, I can use the between and syntax, so I will write
05:59between, press the Spacebar, then I can find the reference that's in my form.
06:04I will drill into the Database folder here, by using the plus button, I will go to Forms.
06:08Right now I have got the form open, so I can find it in Loaded Forms, the
06:11GraphDateRange, and I will double-click on startdate.
06:14Next, I will type the word and, another space, and I will double-click on
06:17enddate, that will add the references to the enddate field and the startdate
06:21field that are on my GraphDateRange form.
06:24Go ahead and say OK.
06:25That adds the criteria down here into my query.
06:28Now I can go ahead and save my query, Ctrl+S to save it, and I will close it out.
06:32Now I can go ahead and choose dates in my form here on the GraphDateRange form.
06:36For instance, I can choose, I will scroll off through this list, may be March
06:401st, 2007 and I will go to the enddate, and I will scroll down, and may be I
06:44will choose a date in 2008, how about February 1st 2008?
06:48Now when I press View Graph, it switches the chart object, because it was
06:52already open, I actually need to refresh it, so I'll press Refresh to get a
06:55new look at the data.
06:56If the chart was closed, for instance, I will close it now, and press View
06:59Graph, it would show me the new data automatically.
07:01So for my end-users the chart will closed, they choose their date range, let
07:05me change it up a little, let me change to December 1st 2009 and go ahead and say View Graph.
07:10There we go;
07:10I have got a new date range here.
07:12So using a few simple objects, I was able to create a couple of selection Combo
07:17Boxes to choose options from, and once I press the button I instantly get a
07:21chart that meets my specifications.
07:23I can change my selection as often as I want and get an endless number of charts
07:27that highlight exactly what I want to take a look at.
07:29Once you get comfortable with each of the control object available to you with
07:33in Access, it's going to be up to you to be creative and figure out effective
07:36ways to hook each of these pieces together to create your database application.
Collapse this transcript
4. Getting around the Database
Creating the main menu
00:00The forms that we have looked at so far have all been linked to a data source
00:03and pulled records from our databases tables.
00:05But forms don't always have to interact with data;
00:08they can be standalone elements that provide interactivity for your end users.
00:11In other words, a form can simply be a blank area where you can group buttons
00:15and capture user intent to help them navigate the database.
00:19When used appropriately, these types of forms can completely remove any need for
00:22your users to dig around in the navigation pane over here.
00:25You can control exactly what your users have access to and often more
00:28importantly what they don't have access to.
00:30In this movie we are going to create a main menu that will help our end users to
00:33navigate the Two Trees database, we will start with a fresh, clean, blank form
00:38in Design View and add some buttons that trigger macros.
00:40Let's go ahead and go up to Create tab, and we will create a new Form in Design View.
00:44In the Property Sheet, if it's not open, you can press this button here.
00:47I will go to the Alt tab, we are just going to go down the list here and
00:50change some properties.
00:52The Caption I am going to change to Main Menu, with space in it.
00:54I am going to tab down to Pop Up, I am going to change that to yes, by
00:57pressing the Y key.
00:59I am going to go down here a few more.
01:00Allow Datasheet View, I am going to turn that to No, Pivot Table View to No,
01:04Chart View to No and Layout View to No.
01:07And again, I am just tabbing through these, and I am pressing the N key to select No.
01:11I want to add a picture into the background, so I might go to the Picture
01:14property and I am going to click Build button here on the right.
01:16We will go to my Exercise Folder here, we are in the Chapter 4 section and I am
01:21going to choose Ojai500x333, this is a picture of the Ojai Valley in California
01:26where our olives are grown.
01:27I am going to go ahead and say OK.
01:28And that will add that image into the background of my form.
01:31Let's go down some more in the Property Sheet, I will go down to the Width Property.
01:35I want to make my form exactly the same width as my image, so I am going to
01:38choose 500 pixel, we will type in 500 px and press Enter.
01:42The height of the form is a property of the detail sections, so we will change
01:45that in a moment, Auto Center, I am going to turn that to Yes, so it appears in
01:48the middle of my stream when it starts, I am going to scroll down some more till
01:52I get the record selectors.
01:53I am going to change No, Navigation buttons, I am going to change that to No.
01:57And I look like I just missed one, I am going to go back to Border style here,
02:00instead of Sizable, I am going to change that to Thin and that will make a
02:03really thin border around the menu system.
02:05I am going to go back down the scrollbars;
02:07I will change it from Both to Neither, so we don't get any scrollbars appearing.
02:11Okay, so let's go ahead and change the Detail section, so we can get the height.
02:14I will click anywhere in the form back here, the Heights property is there
02:17for the detail section, and I what this to be 333 pixels or the same height as my picture.
02:22I will press Enter to apply that.
02:23And this point let's go ahead and save our form here, I am going to press Ctrl+S
02:26and we are going to type in Main Menu.
02:28Now it took the name right here from the name that I had saved as the Caption property.
02:33So that's a fine name for my form, I will just go ahead and say OK.
02:37Next I am going to add a couple of titles in here;
02:38we'll use our Label control for that.
02:40So I will go up and grab one label control, click down here and I am going to
02:43type Two Trees Olive Oil Company and press Enter.
02:45I will add a second label below it here, and I will type in Main Menu, and press Enter.
02:51Let's go ahead and select both of them, I will press Shift and select the other
02:54one, and we will change their formatting.
02:56I will go to the Format tab, I will make them bold.
02:58I will change their color from that gray to a dark gray, maybe this one here, 15% black.
03:03I will make them right aligned, and I will change their font, to let's say 60.
03:08Now that I have changed the font, the text is a little bit bigger than the
03:11bounding box, so I can enlarge the bounding boxes together at once by clicking
03:15and dragging this left corner here, so I'll click and drag that open.
03:18Now I can arrange them together, I'll go to the Arrange tab, Align to Right.
03:24And I'll deselect them all, I will click on the Main menu and I am going to make
03:27that little bigger by going to Format and I will change it's font to 20.
03:31Now I will move them into position, use the up arrow key to move that one, I'll
03:35Shift+Click on this one and then I will move them where I want to.
03:37Let's move it up and over to the right.
03:39Okay, those are in position now.
03:41Let's go ahead and add a couple of buttons to open up forms that are in our database.
03:45We will go to Design tab, use our button control with the Button button.
03:48We will add a button down into our detail section and the command button Wizard starts.
03:53We are going to do Form Operations, open a form, Next, the form I want to open
03:58with this button is the Employee Directory, so go ahead and say Next.
04:01We are going to show all the records, so go ahead and say Next.
04:04And the text for my button, I want to be more specific than just open a form,
04:08because that doesn't have the end-user which form is about open.
04:11So I am going to say View Employee Directory.
04:13Go ahead and say Next and we will take default name and Finish.
04:17So there's one button, let's add a couple of more, we will grab another button,
04:20click below, we go to Form Operations, open a form, Next this time I want to
04:25open up the Review form, so click Reviews and say Next.
04:28Will show all the records again, Next, and I am going to choose text for this
04:31one again, and once again, instead of open form, I am going to say Enter Product
04:35Review, go ahead and say Next and Finish.
04:38Let's add a third button down in the bottom, one more button here;
04:41we will click on the bottom, right?
04:42This time I am going to choose the Application category and the only action here
04:46is Quit Application and that will close Access.
04:48Go ahead and say Next.
04:49The text I want to say, instead of Quit App, I am going to say Exit Database. And say Finish.
04:54Now we can color these a little bit by going to the Format tab, instead of this
04:57blue button for the exit, I am going to change that with the quick styles to a
05:01red, to really call attention to it, it's like a stop button.
05:05The other two, I will highlight both of them at the same time by pressing the
05:07Shift key, and I will change their style to a green color, maybe this green one here.
05:12Now we can arrange them to get them in the position.
05:13I will click the Arrange tab, the Size and Space button and then To Widest will
05:19make them the same width.
05:20Then I will align them together by going to the Align tab and saying Left.
05:23Then I can move them together, move them up a little and align both of them and
05:28I know they are aligned and they are all the same width.
05:30So I will just move these into position with the arrow keys.
05:33Okay, let's go ahead and test out our functionality now.
05:34I will go to the Home tab and click the form.
05:37Now I have got a free-floating Main Menu system here with couple of buttons on
05:41it, let's test the buttons and see if they work.
05:43Now the Exit database one, that's in the close Access, so stay away from that
05:46for just a moment, but we will try to View Employee Directory button.
05:49When I click on that the Employee Directory opens, but this Main Menu is
05:53still in front of it.
05:53So we need to actually engineer these button a little bit differently.
05:57So that they provide the functionality that I'm expecting.
05:59Let's go ahead and close the Employee Directory and we will return to Design
06:02View for this Main Menu.
06:03But if I go to the Home tab now, you'll notice that Design View is grayed out here.
06:07Now that this is a free-floating window, I have to actually right-click in the
06:10window and say Design View from here.
06:12Now if I click on the button and take a look at its Properties under the Event
06:15tab, the On Click event, this has this embedded macro, and this is what the
06:18Wizard created for us when we created the button.
06:21We can click the Build button over here on the right to edit the macro that was created.
06:24I will click on Build and we can see that the macro right now just has one
06:27step, it's opening a form, we will see that the macro just has one step right
06:30now, it's opening a form here and it's this Employee Directory form, it's the
06:34one that's opening.
06:35I want to actually add another step here.
06:37Let's go ahead and add a new action right here, we are going to use the
06:40Close Window action.
06:41Now the Close Window action will close the active window if I leave the
06:45Arguments blank, or I can specify a window that I want to close.
06:49But if I leave it blank now, what's going to happen is, Access is going to open
06:52the Employee Directory and then close the active window, which since we just
06:56opened the Employee Directory, is going to be the Employee Directory.
06:59So I need to make sure that the Close Window property is first, so I will move
07:02it up in the list using this up arrow here.
07:04So now when I click on the button, it will close the active object which is
07:07going to be the Main Menu window, and then it will open the Employee Directory.
07:10Go head and close this macro and Yes I will save that change.
07:14We will do the same thing to the other button, I will click on it, click the
07:17Build button over here on the right.
07:18I will use the CloseWindow action and I will move it up on the list.
07:23Go ahead and close and save your changes and now let's test it out, go back
07:27to Form view, on my window, my free-floating Main Menu here, I will click
07:31View Employee Directory.
07:32The first time I do that, since it's going to close this Main Menu, it's going
07:35to ask if I want to save my changes.
07:36So Yes, we are going to make sure we save that.
07:38And there is my Employee Directory.
07:40Now the last thing I need in order to make this a full circle, I need to provide
07:43a way to get back from my Employee Directory to the Main Menu.
07:46So once again we will go to Design View for the Employee Directory, we will
07:49add a button to the header up here, this is going to be Form Operations, open a form, Next.
07:55This time we are going to open the Main menu form, Next.
07:57The text for that is going to be Return to Main Menu, Next and Finish.
08:03And again, we will need to change that macro a little.
08:05So the On Click event in the Properties will go to the Build button here, we
08:09will add Close window and we will move that up to the top, close the window
08:15here, and we'll save that macro.
08:17I am going to change the style of the button here;
08:19I will go to Quick styles and choose the same green, just so we are
08:22consistent throughout this.
08:24Go to the home tab, view our form and I could test out that button.
08:27It's going to ask me if I want to save the Employee Directory changes, so
08:30Yes, and there we go.
08:31Now I can view the Employee Directory, when I am done looking for the record I
08:34am looking for, return to Main Menu, and then back to where I started.
08:37And as our database grows, as we add additional functionality through other
08:40forms and reports over here, we can return to this Main Menu form and add
08:44additional navigation buttons that will get our users to where they need to
08:47go and back.
Collapse this transcript
Adding a splash screen with startup options
00:00A Splash Screen is a small window that displays when a program is loading.
00:04It stays on the screen for a few seconds and then it disappears.
00:07You've probably seen the Microsoft Access Splash Screen every time you start the program.
00:11Adding a Splash Screen to your database and setting some startup options is a
00:14great way to create an engaging startup sequence to your database.
00:17Now, whenever I can reuse content that I've already created, I'm going to go
00:21ahead and do that, because it's going to save me time.
00:22For instance, we've created those Main Menu in the last movie, if I double-click
00:26on it, I can open it.
00:27I want to create a Splash Screen now that reuses some of the similar
00:30content from the Main Menu.
00:31Let me close the Main Menu and I'll right-click on it and say Copy.
00:35Then I'll come down here in my navigation pane, I'll right-click and say Paste.
00:38Access is going to ask me for a new name and I'm going to call this
00:41Splash Screen and say OK.
00:42Now, I've got a duplicate of my Main Menu that I can use to create my Splash Screen.
00:47I'll double click on it to open it and then I'll right click on the form here
00:50and say Design View.
00:51Now, for my Splash Screen I don't need any buttons.
00:54So, I'm going to highlight all three of these and then I will press Delete.
00:56I'm also going to change the image that's in the background.
00:58So, I'm going to select my form here between the two rulers.
01:01On the Format tab I'm going to go to this Picture here and I am going to
01:04click the Build button.
01:05I'm going to go back to my Desktop in the Exercise Folder 4, and I'm going to
01:09choose OliveSplash500x125. Say OK.
01:13It adds the new image into the background.
01:15And when I change the picture alignment here, instead of Centre, I'm going to
01:18change it to Top Left.
01:19Then I'm going to go to adjust the height in my Detail section.
01:22So, click in the background back here, and the Height, I'm going to change to about 2 inches.
01:26Next, I'm going to use the two labels that I have for my Main Menu for my Splash Screen.
01:30So, I'm going to move those down.
01:31We'll highlight both of them and I'll use the arrow keys to move them down.
01:35Next, I want to change the label of Main Menu here to Access Database.
01:40Some other things that you can add to a Splash Screen, you might consider adding
01:43a hyperlink to e-mail the database designer if there are any problems or other
01:47copyright information or versioning information.
01:49So, there's our basic Splash Screen.
01:51Let's go ahead and save it.
01:52I'll press Ctrl+S and close it out.
01:54Now, let's double click on it to open it and there's one thing else that I
01:57want to change here.
01:58Right now it's got a small around it.
02:00We can actually get rid of the border entirely in the properties.
02:03So, I'll right click on it, go into Design View, in the Form properties here
02:07I'll scroll down to Border and I'll change it from Thin to None.
02:11Once again, we'll go to Form View to view it and that's looking much better.
02:15And right-click on it and close the object, and that's going to save the
02:18design and we'll say Yes.
02:20Now a Splash Screen ideally should open up when the project opens and then
02:23close automatically.
02:25We can choose the Close Automatically from the properties as well.
02:28One more time we'll go to our Splash Screen, I'll right-click on it in Design View.
02:32On the Event tab for the properties, if I scroll down, I'll find the On Timer event.
02:37The On Timer event will automatically fire after a specified interval.
02:41Let's go ahead and build our On Timer event using the Build button.
02:44When I click the Build button Access asks me which building method I want to use.
02:48I can either use the Macro Builder, an Expression Builder or if I know Visual
02:51Basic code, I could use a Code Builder.
02:53I'm going to use a Macro Builder and say OK.
02:55Now, the first thing I want to do is close the Splash Screen.
02:58I'm going to say CloseWindow.
03:01I can leave the Object Type blank because it'll close the active object, which
03:04by design is going to be the Splash Screen.
03:06The next thing I want to do is open the Main Menu form. I'll say OpenForm.
03:10I can specify what form I want to open using the drop-down menu, choose Main Menu.
03:16I can also specify what view I want to view it in and what window mode, but I
03:19can leave these defaults.
03:20We'll go ahead and close our Macro and we'll save our changes.
03:24Now, we need to specify the Timer Interval that will wait before applying this macro.
03:28The Timer Interval is entered in milliseconds.
03:30So, if I want to do 3 seconds, I would type in 3000.
03:33Go ahead and press Enter to finalize that value.
03:36We'll close our form, we'll save the changes and we'll double-click on it to see if it works.
03:40It pops-up for 3 seconds, disappears and the Main Menu appears.
03:44So, the last thing we need to do is create a Splash Screen and have it open,
03:48right when Access opens.
03:49We'll close the Main Menu, we'll go to File, Options, we'll switch to the
03:54Current Database options and right here where it says Display Form and says
03:58none, I'm going to choose my Splash Screen.
04:00This is what will display as soon as the database opens.
04:03Now, I can change a couple of other properties while I'm here.
04:05For instance, I can change the Display Navigation Pane.
04:08I can turn that off and if I scroll down, Allow Full Menus, let's turn that off as well.
04:14Let's go ahead and say OK.
04:14So, it's going to say I must close and reopen the current database for the
04:18specified option to take effect.
04:19Let's go ahead and say OK.
04:20And we'll Access and we will reopen it again to see what our changes look like.
04:24We'll close Access.
04:26I don't need to keep anything on the Clipboard, so that's fine.
04:28And I'll reopen my file.
04:30I'll double-click on 4-2 SplashScreen, there's my Splash Screen.
04:333 seconds later the Main Menu appears.
04:35You notice that I don't have my navigation pane anymore, and that it don't have
04:38most of the tabs on the ribbon, but I can still go to View Employee Directory
04:42and back, and I can Enter a Product Review or exit the database.
04:45Now, I don't want this to look like this is securing the database in anyway.
04:49The navigation pane is still available using the shortcut key F11.
04:53If I deselect my Main Menu by clicking on the background and then pressing F11,
04:57the navigation pane appears.
04:58Also, if I press the Exit Database button here to go back to Windows and then
05:03hold down the Shift key while I double-click on my file, Access will actually
05:06bypass all of the startup options.
05:08So, the navigation pane is here, the tabs are here, and it doesn't automatically
05:11run my Splash Screen.
05:12So, hiding the navigation pane and minimizing the ribbon doesn't actually
05:16secure your database in anyway, it just keeps things out of sight and
05:19potentially out of mind.
05:20So, a well thought out user interface is a really nice thing to have in your
05:23database and something your end users will appreciate.
05:26These little bits of polish, the details that you put into your database can
05:29take something that might otherwise just be a tool and make it something that
05:33people really actually enjoy using.
Collapse this transcript
Creating a customer form
00:00So far we've taken a look at creating navigation forms to move around our
00:03database, we've created a reference form in our employee directory and we've
00:07created a form that looks up orders that include a particular product.
00:10Let's now create a form that can be used to import records into our data tables.
00:14We'll create a form that can be used to capture information about new customers.
00:17I'm going to close our Main Menu window here and I'm going to click once on my
00:21DirectCustomers table and go to the Create tab and by clicking on Form we'll
00:24build a quick form that I can then edit.
00:26So, there's my form here, it's showing me data at the top and if I scroll down I
00:30can see that Access automatically put in a subform.
00:32Let's go into Design View.
00:33I'll change my View to Design View and we'll clean this up.
00:36First, I'm going to scroll down and I'm going to get rid of that subreport.
00:39I'll click on it and press Delete.
00:41I'm going to scroll back up.
00:42Next, I want to get rid of these headers.
00:43So, I'll click on the Detail section and then right-click and turn off
00:47Form Header/Footer here.
00:48Since, there's content here, I've got an icon and this label.
00:51Access is going to confirm that I want to delete those.
00:53So Yes, get rid of that.
00:55Next, I want to realign some of these objects.
00:58They're pretty big for the data that's inside.
01:00Now, by default Access groups everything together so it's easier to edit in Layout View.
01:04I think it's even still easier to edit things in Design View.
01:07In order to do that though, I need to ungroup these objects.
01:09So, I'm going to press Ctrl+A to select everything.
01:12I'll go the Arrange tab and I'll say Remove Layout.
01:16Now, these elements are all individual.
01:18I can deselect them by clicking off in the space above.
01:21I'm going to resize this Customer box here, make it a little shorter.
01:25Now, I'll select everything again, and I can go, Size/Space>To Shortest, to make
01:29them all the same height.
01:30Then I can go to Size/Space and say Decrease Vertical to make them all evenly
01:35spaced and decrease the size a little.
01:37Now, I'll do that a couple of times to bring them all together.
01:39Size/Space>Decrease Vertical.
01:41We'll do it a few more times to nudge them all together.
01:44Next, I'm going to resize my form.
01:47So, I'm going to deselect all of these objects and then I'm just going to select
01:50the ones on the right.
01:51I'll scroll over, I'll grab the right edge and I'll bring it in to maybe about 3 inches.
01:55Then I'll grab the right edge of my form and drag it into about 3.5. I'll scroll over.
02:01It's looking good.
02:02I need to bring the bottom up now.
02:03So, I'll scroll down.
02:05So, I'll scroll down and drag the bottom up, maybe about 4 inches.
02:08That leaves me enough room at the bottom to add some command buttons.
02:11Now, let's take a look at some of the properties for our form.
02:13I'll select out form selector here between the rulers.
02:16I'll go to the Other tab here and I'm going to make this a pop-up window.
02:19So, instead of No, I'm going to choose Yes.
02:21I also want to make sure that the user interacts with this form or closes it
02:25before they can do anything else in the database.
02:27So, I'm going to choose Modal to Yes as well.
02:30In the Format tab I can find the Caption property.
02:33The caption is what's going to appear at the top of the window.
02:35Here, I'm going to say Add a new customer.
02:37I'll press Enter and then finally in the Data section in the Data Entry property
02:42here, it's currently set to No, I'm going to change that to Yes.
02:45What that will do, is it'll force this form to only enter in records into
02:48the customers table.
02:49It's not going to allow me to view records that are in the customers table, it's
02:52just for data entry.
02:53Let's go ahead and press Enter to finalize and we'll view our form here.
02:57I'll switch to Home and view into Form View.
03:00So, there's my form.
03:01I might want to get rid of these record selectors and this bar over here on the right as well.
03:05So, let's go ahead and go back into Design View.
03:07I'll right click, Design View.
03:09I can find those into the Format tab.
03:10We'll scroll down till we get to Record Selectors, change that No and Navigation
03:15Buttons, No as well.
03:17Now, we need to add a couple of buttons, so the user can interact with our form.
03:19We'll go to the Button wizard by clicking the Button control and pressing the button there.
03:23Now, let's take a moment here and think about the workflow here.
03:26When you enter in records into Access, Access is automatically saving those
03:30records straight into the data table.
03:32So, if the end-user comes to this form and they type in some values and then
03:35they close the form, what's actually happening is that Access is taking the data
03:39and saving it to the table before the form is closing.
03:42So in essence, closing the form is the same as saving the data and closing the form.
03:47If I want to have the ability to cancel out, so for instance, you might have
03:51typed something in and then decide you don't want to do that, before I can
03:54cancel, what I need to do is make sure that these fields are cleared out,
03:56that they're empty;
03:57they don't contain any data before closing the form.
04:00If they contain anything at all, that's going to get saved into the data table.
04:03Now, I want to make sure that I have an easy workflow for my end-users and they
04:06don't really have to worry about that.
04:07So, I'm going to create two buttons here.
04:09One is going to be Save Customer and the other one's going to be Cancel Entry,
04:13but I need to think about these macros a little bit in order to make the
04:16functionality work as intended.
04:17So, this first one is going to be the Save Customer one and I can go to Form
04:21Operations and Close Form, and the act of closing the form will automatically
04:26save those records into the table.
04:27Let's go ahead and say Next.
04:29The Text button, instead of Close Form, we're going to say Save Customer,
04:34and we'll say Finish.
04:35So, there's my first button.
04:36The second one is going to be a little bit more complicated.
04:38We'll add this button control;
04:40we'll add that down below.
04:41This one we need to clear out the records first.
04:44So, we're going to go to Record Operations and then Delete Record, that will
04:48clear out everything within this form.
04:49Let's go ahead and say Next.
04:51The Text for this button is going to be CancelEntry, we will press Next and Finish.
04:57Now, when I click this button CancelEntry, it's just going to clear out the form.
05:01I'm going to actually edit this macro, so that it clears out the form and
05:04then closes it as well.
05:05So, again, for the button, we'll go to the Event tab, the On Click event is this
05:09Embedded Macro that we just built with the wizard.
05:11I'll click build to edit it, and you can see all of the error controls that
05:14Access added into this macro.
05:16All I need to do is scroll to the bottom, we'll add a new action and we'll say CloseWindow.
05:21We can leave the Object Type and Object Name blank.
05:23It'll close the active window, which is going to be that Add Customer form.
05:26I'll close my macro and save that change.
05:28Let's go ahead and format our buttons, I'll Shift+Click to select both of them.
05:32Go to Format, we'll choose our green style, so we're consistent throughout the database.
05:37We'll go to the Arrange tab;
05:39we'll Size/Space them To Widest, and then we'll Align them to the Right.
05:44Now, they're aligned inside the same, I can use my arrow keys to nudge them into
05:48position, and I'll just put them over here on the right.
05:50So, they align up with the edge of my text boxes. All right!
05:52Let's go to the Home tab and view our form here.
05:55So, there's my Add a New Customer form, it's a pop-up form.
05:58I can type in some values here.
06:00I can Save the Customer or I can Cancel Entry.
06:02Right now I'm going to go ahead and cancel this entry.
06:04It's going to ask me if I want to save this and I'll go ahead and say Yes, I'll
06:07save that form and it'll ask me for a name.
06:09I'm going to create this as Add a new customer, that's fine.
06:11Go ahead and say OK.
06:12Now the final step of our workflow is to add this into our Main Menu structure.
06:16I'll double click to open up our Main Menu and then I'll right click on it to
06:19go into Design View.
06:20We'll add a button here that says Form Operations, Open the Form, Next.
06:26We want to open the Add a new customer form, Next and Finish.
06:30Now, we've got a button that'll edit that.
06:32It's got an icon on it, I can change that.
06:34If I go to the Format tab where it says no Picture Caption, I can change that to Right.
06:40We'll add text to the right side.
06:41The caption here will be Add a customer.
06:43I'll make my button a little wider, we'll format its color, and we'll move it into position.
06:50Let's go ahead and close our menu.
06:53We'll save our changes and we'll look at our workflow now.
06:57I'll scroll down, double click on Splash Screen.
06:59We'll see the Splash Screen works.
07:00It opens up the Main Menu.
07:02Now, I can click Add a new customer.
07:03I get my new customer window, I can type in the values and Save, or I can
07:06cancel the process.
07:07So, data entry tasks don't really have to be a chore, with a little thought into
07:11the layout of a data entry form, your end-users will be able to quickly and
07:15accurately capture the information that you need to store in the database.
Collapse this transcript
5. Report Layout
Grouping and sorting data
00:00Access's way of preparing material and data for the printed page is through the report object.
00:05Reports take data from tables and queries, applies formatting and organization
00:09rules, and bundles all of it together into documents that are ready to be sent
00:13to a printer or a PDF file, for example.
00:16In this movie, we're going to take a look at how Access organizes data into
00:19grouping and sorting levels.
00:20If you've ever used the totals row within a query, this may seem somewhat
00:24familiar, as the concept is really similar.
00:25Let's get away from the Olive Oil Company for just a moment and we're going to
00:29take a look at a database that's all about playing cards.
00:31I'm going to double-click on this table here called Draw.
00:33We can see that this table has 5000 total records at the bottom here, and we
00:37have a listing of randomized cards.
00:39Basically, I took a random card from a deck of cards and I made a record of each pull.
00:43So, for the first pull I had 6 of Hearts, on the second pull I had 4 of Clubs.
00:47Let's go ahead and close the table and we'll take a look at a summarized look
00:51using this query here, DrawResults.
00:52I'll double click on the query and we see that this query is counting up the
00:56number of times each card appeared out of the total 5,000 draws.
01:00My Queen of Diamonds for instance, had 121 showings, the Four of Clubs appeared
01:04118 times, and if I scroll to the bottom here, I can see that the Six of Hearts
01:09showed up the fewest number of times in my random drawings at 76.
01:12Now, this is the data that we're going to use to build a report off of.
01:15Let's go ahead and close the query, but I'll keep it selected over here in
01:19the navigation pane.
01:20I'll go to the Create tab, in the Report section we'll click on the Report button.
01:24Access will create a very simple report for us based off of the data in that query.
01:28Now, the default layout with all the records alphabetized doesn't really allow
01:33for a detailed understanding of our data.
01:35For instance, looking over this report could you tell me which card appeared
01:38most often or how do the King of Clubs rank out of all of the Club cards?
01:42This report is not organized very we'll at the moment;
01:44it can't even help us to answer these very basic questions.
01:47We can fix that using the Group & Sort options to better understand the layout.
01:51We can turn on Grouping & Sorting and the Grouping & Total section of the Design ribbon.
01:55Press this button here and we'll see a new window up here at the bottom.
01:57Inside of this window we have two options.
02:00We can either Add a group or Add a sort.
02:02Let's start by adding a sort.
02:03I'll click on Add a sort and then Access asks me which value I want to sort on.
02:07Let's go ahead and sort on the CountOfID that's the number of times it appeared.
02:10I can also choose to sort it from smallest to largest or using the drop down, I
02:15can change it to largest to smallest.
02:17Now, I can see which card appeared the most times.
02:19We can also use the Grouping & Sorting to group like values together.
02:22Let's go ahead and delete this sort right now, using the X on the far edge of the bar.
02:27This time I'll Add a group, and let's say we want to group all of the cards
02:30together by color, so that all the black cards are together, and then all of the
02:33red cards appear together.
02:34I can choose SuitColor.
02:37Now, I can see in my report, I've got black here at the top and then all my
02:40black cards, the Spades and Clubs, and if I scroll down, I'll find the Red
02:44cards, and then that's where the Hearts and Diamonds are.
02:47Now, within this grouping, we can add an additional grouping.
02:49Right now we've got a group for Red color.
02:51Let's add another group below that by Suit.
02:53We'll add a group down here at the bottom, we'll say SuitName.
02:57Now, we'll start at the top of the report.
02:58I've got Black Clubs, there are all my Club cards, and I'll scroll down, then my
03:03Spade cards, here they are.
03:05Scrolling down further, I get to the Red section with Diamond startingm and
03:10scrolling down further, there're my Heart cards.
03:13Now, within that we can add a sorting, so we can sort them ascending or
03:16descending by the value that they appeared.
03:18We'll Add a sort now, we'll say CountOfID at this point and we'll change it
03:22again to from largest to smallest.
03:24So, now they're ranked in order, but grouped by suit name and suit color.
03:27Now, let me take a look at this report in Print Preview mode.
03:30We'll switch our view here at the top, we'll click the down arrow and we'll
03:33choose to go to Print Preview mode.
03:36In Print Preview I can scroll through the report and see what it looks like.
03:39Now, when I get to the bottom of the page here, I notice that my Red section
03:43actually starts here, but the vast majority of that data is on page number 2.
03:46I'll select this button to change our page and I'll scrub and this is the
03:50rest of the Red data.
03:51I can use our Grouping & Sorting levels to help control where the page
03:54breaks fall for my report.
03:55If I close Print Preview, it will take me back to Layout View and here on Group
04:00on SuitColor, I can click the More button right here, and one of the More
04:04Options that I have is do not keep group together on one page.
04:07I can change that to keep whole group together on one page.
04:11Now, if I go back to Print Preview and take a look at it, I can scroll down,
04:15here's my Black Club cards, scrolling down, here's Spades.
04:18I get to the bottom of that and I don't have the Red cards anymore.
04:22I actually have to go to page 2 and up at the top to get to the Red Diamonds and Hearts.
04:27So, understanding grouping and sorting behavior within your reports is key
04:31to creating documents that deliver the information needed in the most
04:34organized manner possible.
Collapse this transcript
Understanding report structure
00:00The structure that Access uses to assemble the reports on the page is kind of
00:03like building a layer cake or maybe even designing blueprints for a skyscraper.
00:07There are multiple sections that can design one time each, but then Access
00:11uses that blueprint over and over again as it needs them for each section of the report.
00:15Let's take a look at how this works.
00:17Now, we're back in the Two Trees database here and I've got a query set up here
00:20called OrdersByRegion.
00:21Let me double-click on that so we can see the data.
00:23The OrdersByRegion query is giving me a total count of all the orders that
00:27appeared in each region for each year.
00:29So, I can scroll through the list, I've got 2005 and 2006 and 07 and so on.
00:34For each Region and Division I've got a count of the number of products
00:36that came from there.
00:37Okay, let's build a report off of this data.
00:40I'll close the query.
00:41In my Create tab I'll click on Report, and Access generates a basic report.
00:46Let's switch into Print Preview mode to take a look at the full sheet.
00:49We'll go to View>Print Preview.
00:52Now, I can scroll through this report and I can see that there are multiple
00:55sections that get repeated.
00:56At the very top of the page I've got what's called the report header.
00:59The report header appears once at the very top of the very first page.
01:03After the report header, I've got the page header.
01:05This page header includes Year, RegionName, DivisionName and
01:08CountOfOrderID fields.
01:10These are the header names that appear at the top of the columns of data.
01:13The page header appears at the top of every single page.
01:16After the page header, we have Details.
01:18Each detail section is one record from our database.
01:21So, 2005>Midwest>East North Central and 49 represents one record from our query,
01:27and this is one instance of the Detail section.
01:29The Detail section repeats over and over again for every record that we're reporting.
01:32Let me scroll down to the bottom.
01:34When we get to the bottom of the page, we have what's called the page footer.
01:38The page footer appears at the bottom of every page and this page footer is
01:41showing me what page number of the report I'm on.
01:43If I click the Next button here to go the Next Page and then scroll back up to
01:47the top, we'll see another instance of the page header, because we're on a new
01:50page, more details and scrolling down at the bottom here, when I run out of
01:55details or when I run out of records to report, I have what's called the report footer.
01:59In this particular report footer, it's cut off a little bit, but it's giving me
02:02a calculation to show me how many rows I'm having in my report.
02:04And on the very bottom of the page, I've got another instance of the page footer.
02:09So again, it's saying I'm on Page number 2.
02:10Let's go ahead and take a look at what this report looks like in Design View.
02:13I'll Close Print Preview;
02:15it's going to take me back to Layout view.
02:17So, I'll go to the View menu here and switch to Design View.
02:21In Design View the report looks much different than what you might have expected.
02:24Each section is repeated only one time here, I only have to design it once.
02:28So, I've got my report Header Section here with the icon and the title, I've got
02:32my Page Header section here with the titles of the columns of data, I've got the
02:36Detail section, this is where the data appears, I've got the Page Footer, which
02:40has the calculation for the page number and I've got the Report Footer with the
02:43calculation of the number of records I'm reporting.
02:46When designing your reports it's important to keep in mind that you want to
02:49keep each section as narrow as possible because it's going to get repeated over and over again.
02:53For instance, if I take my Detail section here and make it a little bit taller
02:56by clicking right above this Page Footer bar and dragging down.
02:59So, I'm just going to add a little bit of white space here, but every single
03:02time I have a row of data it's going to repeat that white space.
03:05So, if I look at that small change in Print Preview mode here, you'll see
03:09that it makes a much bigger difference in my report, because it repeats so many times.
03:13Let's go back to Design View and reverse that change.
03:15I'll grab this bar and drag it back up.
03:18So, in the last movie we talked about grouping levels.
03:21When it comes to header and footer sections, each grouping level can have its
03:24own headers and footers.
03:25We can change the grouping level here or we can change it in Layout View like we
03:29did in the last movie.
03:30The advantage of doing it in Layout View is that it moves items around for us
03:33automatically as we make any changes.
03:35So, let's take advantage of that.
03:36We'll switch our View here to Layout View and then we'll Add a group.
03:40We're going to group based off of the region.
03:43I'll click on RegionName and then we'll sort by Year.
03:45We'll Add a sort, and we'll sort by Year.
03:49Now, let's take a look at this report in Design View again, to see the
03:51changes that were made.
03:52We'll go to View>Design View, then we'll see I have a new section here
03:56called RegionNameHeader and the RegionName box has been moved up from the
04:00Details to the RegionName.
04:01Now we'll only see a RegionName every time we get to a new region.
04:04When I change my View to Print Preview, you'll see that in action.
04:08So, I've got my Midwest region.
04:10I don't see the word Midwest repeated over and over again.
04:13I can scroll down and I've got my Midwest data.
04:15When I run out of Midwest data, I've got my Northeast data, and scrolling
04:18further, my South data.
04:19I can scroll back up.
04:21We'll Close Print Preview and go back to Design View.
04:24Now, I can make one small change to this report that will help clarify the data.
04:27When I created this RegionName header, the region name appears every single
04:30time, but the Page Headers up here are where the titles of the columns of data appear.
04:35Those are still appearing only once on each page.
04:38I can move these down, so every time I have a new region name, I repeat the
04:41title of the column, that'll help keep your bearings as you scroll through the report.
04:44I can go ahead and click on this Year box here and in drag it down to the bottom
04:48section below, to the RegionName header.
04:50I'll click on DivisionName, and I'll click and drag that down as well, and
04:54finally, the CountOfOrderID, and I'll drag that down.
04:58One more time in Print Preview view, I'll change my View here, and now I've got
05:02the Midwest, I've got the Year.
05:03DivisionName and CountOfOrderID columns.
05:06As I scroll down, when I get to Northeast, I've got those column headers
05:09repeated again every time I have a new region.
05:11So, I don't lose track of what the column of data means, as I scroll through the report.
05:15Now, there's one more thing that I want to change on this report and this really
05:18drives me nuts about the way Access designs its automated reports.
05:21Every time you create one of these automatic reports, Access puts boxes around
05:24everything and it really doesn't add anything to the legibility of this report.
05:28So, let me clean that up really quick.
05:29I am going to Close Print Preview view, that will take us back to Design View.
05:33I can go to the Format tab, click the Select All button or press Ctrl+A on your keyboard.
05:38Let me go over to Shape Outline and change it to Transparent.
05:42We'll take a look at the change in Print Preview, Print Preview here, and you'll
05:47notice that this report is certainly much easier to read.
05:49So, you'll see the same header and footer options available to you when you
05:53design forms, but they're really only applicable to forms that are set up with a
05:57continuous view property turned on, like our Employee Directory.
06:00So, headers and footers are a limited value in forms, but they would work
06:03the same way there.
06:04In reports however, headers and footers coupled with grouping and sorting levels
06:08create the primary structure within which your data will be organized.
Collapse this transcript
Building reports from wizards
00:00Reports don't know anything about data.
00:02All that report knows is formatting, this font and this color and this
00:06position and that's it.
00:07For all of their data needs, reports rely on a data source.
00:11Data comes either directly from a Table or a little more roundabout from a Query.
00:15The nice thing about using a Query as a data source is that you can bring in
00:18fields from multiple related tables, calculated fields and added expressions and
00:23give it all to the report in one nice and tidy package.
00:25When using a Query, you have the option of using a pre-build query that you
00:29could find in the Navigation Pane over here or create what's called an Embedded
00:33Query directly inside of the reports.
00:35Let's take a look at how our reports get data by having the way they walk us
00:38through the first two steps.
00:39We can find the Report Wizard on the Create tab right here in the Report section.
00:44I will click Report Wizard.
00:46Let's work towards getting a report that looks at our customers orders.
00:49Now the Report Wizard looks and feels just like the Query Wizard if you
00:52have ever use that feature and that's because essentially, that's exactly
00:55what we were doing here.
00:56We are just building a query with a few added steps to design the report.
01:00We are going to start our report with information from the Orders table.
01:03I will select it from the list, and then I will add Order ID, Order Date,
01:08Customer ID and Product ID to the table.
01:11We will go back up here and select a related table, the Direct Customers table
01:15at the top, and from here I will get FirstName, LastName and State.
01:21Finally, I need to get the price of the products so I can get their total spent,
01:24I can get that from the Products table and that's where I will find Price.
01:28We will add that to my report as well.
01:31Go ahead and say Next, Access asks as how do we want to view our data?
01:34This window looks identical to when we saw in the Form Wizard.
01:37We could choose by tbl_Products to group everything by Price or by Customer to
01:42group everything by name.
01:43I'm going to leave it as by Table Orders, go ahead and say Next.
01:48Now within that, how do I want to group our data?
01:50I want to group it by State and then add over, go ahead and say Next.
01:55In the sorting section I want to sort by Price and I want to sort it Descending,
01:59so the highest value appears to the top.
02:01Go ahead and say Next.
02:02It looks at the default Layout and Orientation for the paper and say Next.
02:07And we will go ahead and give this a title.
02:09We will call it OrdersByState.
02:10We will choose to Preview the report and say Finish.
02:15So here is our basic report.
02:17We can see we have everything grouped by the state.
02:19I have got the summarize total of the spend in Price here, descending I have got
02:23the OrderDate, the CustID, the Products that they ordered and the First and Last
02:28Name of the person who ordered it.
02:29Let's go ahead and take a look at this in Design View.
02:31I will Close Print Preview and I return them into Design View.
02:35Now let's take a look at where that query went that we just built with the wizard.
02:38If I go to the Property Sheet here and if it is not selected, we will select
02:42entire report by clicking this black button between the rulers.
02:44We will look at the Data tab and the Record Source we can see the Select statement.
02:48Now if you have taken my Queries in Depth course here at lynda.com, this might
02:52look really familiar to you.
02:53This is telling me that this is using a query in the background.
02:56I can click the Build button to see that query.
02:58That will take me into a Query design session where I could take a look at what
03:01the Wizard created for us as we click through the menus.
03:04We can run this query just like any other query to see the data table behind it.
03:07I will click on Run.
03:09And I can see that data table.
03:10So this is a data that's getting formatted by the report.
03:13Let's go ahead and back in the Design View for the query.
03:16The name of the query right now is Orders By State : Query Builder.
03:20This is telling me that this is a query inside of this report.
03:23It's not going to exist in my Navigation Pane over here.
03:26Now we can edit this query, for instance, you might want to make changes to a
03:29query and you might think, well if I want to summarize by Total price, I can
03:33click on the Totals button here and I scroll over to price, and under Total I
03:37could say, Sum, if I Run the query, the query works just fine.
03:42The problem is, is that Access has created links to the field names in the
03:46query, to the text boxes that are in the report already.
03:48And when I group by SumOfPrice, it changed to the column name from Price to
03:52SumOfPrice, and thereby breaking the link to the fields that are already on the report.
03:57Now you can fix this, there is no problem with that.
03:59But it does take a lot of clicking.
04:01But now that we know what powers the Record Source for our reports, let me go
04:04ahead and back out to this query and I am not going to save any changes.
04:08We have got the Select statement here is where the date is coming from our Record Source.
04:11I have got the Select statement here, it's providing the data for the report.
04:15I could also use the drop-down menu here, to select any of the Queries or Tables
04:19so I could manually choose a Record Source.
04:21We can smooth out our workflow by first creating a query that gathers exactly
04:25the information we want including any aggregation or calculations, and then
04:29build a report on that afterwards.
04:30That's going to be topic of the next movie.
04:32Now one last thing, the Record Source property in the Reports functions exactly
04:36the same way when bringing data into a form.
04:38You can go back through some of the forms that we have created throughout this
04:41course, explore the record source property and find out if we're using a table
04:45reference, a query reference or an embedded query to generate those records.
04:49Of course with forms, you also have the option of having an unbound form, that
04:53isn't connected to any data source, such as our Splash Screen and our Main Menu forms.
04:56Whereas reports, we will kind of worthless if left unbound.
Collapse this transcript
Building reports from queries
00:00Building a report off an existing query is probably the easiest way to get
00:04a great looking report that displays some fairly complex information from your database.
00:08By leveraging the power of queries, and feeding the results into the report's
00:11record source, you'll create a good foundation from which report design becomes
00:15just a matter of dragging-and-dropping fields into the appropriate locations.
00:18I've said this before about Access, but sometimes all of the wizards and
00:22automated object-creation features of the program can really get in the way and
00:25just make things more confusing than they really are.
00:27Once you understand what's going on behind-the-scenes, it's often the case that
00:30the hand-built from the ground up really is the way to go.
00:33In this exercise, I've gone ahead and pre-built a query that totals up our
00:36customer's lifetime spent amount with the Two Trees Olive Oil Company.
00:39Let's go ahead and open up TotalSalesCustomers query.
00:42I'll double-click on it to open it and we'll see that we're getting our first
00:46and last name of the customer, the total amount of money that they spent with
00:48the company, and the state that they are from.
00:50Let's take a look at this query in Design View.
00:52I'll close the Property Sheet over here to give myself some room.
00:55So I've got my four tables that I'm building this off of;
00:58Customers table, the Orders table, the Products table, and the States table.
01:02From those four tables, I'm pulling the first and last name, the price, and the state name.
01:07And on Price, I've got the Totals turned on and I'm adding up the values with
01:11the Sum function here.
01:12So this is the data that we're going to be using in our report.
01:14I'll go ahead and close the query.
01:16We'll start creating a new report from scratch.
01:19I'll go to the Create Tab and inside of Report & Design view.
01:21Now, just like with forms, the first thing I want to do is connect it to a data source.
01:26I'll go ahead and go to Property Sheet, we'll look at the properties of our
01:30report, and we've got this Record Source property here.
01:32I can use the drop-down menu and choose the query TotalSalesCustomers.
01:37At this point, we can go ahead and start setting up the sections of our report.
01:40We'll go to the Design Tab, the Group & Sort section, turn that on, and
01:45then we'll add a group.
01:45I'll click on Group;
01:46I'm going to group this by state.
01:48Go ahead and click on the StateName.
01:49That will add a StateName Header to our report up here at the top.
01:53I'll also add a sort.
01:54I'll add a sort and I'll sort the values within the states by the Lifetime Sales
01:58or the total spent amount.
02:00Let's go ahead and turn off Group & Sort to get rid of that window and I'm
02:03going to scroll down.
02:04Now, we've got that Detail section to make it a little smaller, here and I'll drag this up.
02:10Now I can see everything on one screen.
02:12At this point, we can just start dragging-and-dropping fields and dropping
02:15them into our reports.
02:16I am going to go to Add Existing Fields.
02:18Since I've connected this to a data source, these are the four fields from that query.
02:22So I'll take FirstName, LastName, and Lifetime Sales, and drop them into
02:26the Detail section.
02:27I can just double-click on each one.
02:29I'll take StateName and I'm going to drag-and-drop it into the StateName Header, here.
02:37Now, let's go ahead and rearrange these a little bit.
02:38I'll type FirstName, and I'll drag it and I'll put it up here at the top,
02:41take LastName, put it at the right, and I'll drag Lifetime Sales and I'll put
02:46it to the right of that.
02:47Now the labels that came with them, right now they're overlapping a little bit.
02:51I can have those repeating every time I have a new state, I will have the labels
02:54with the columns of data below.
02:56But unfortunately, you can't move these labels just directly across from the
02:59Detail section to the StateName Header.
03:01You try and drag them using the top-left anchor, it'll just hit that wall, and
03:04it won't move across.
03:06So what we can do is copy and paste them up in the State Header section.
03:09I'll select each of the labels;
03:11the FirstName label, and I'll Shift+Click on LastName Sales and this
03:14FirstName label here.
03:15I'll press Ctrl+X to cut.
03:18I'll select my StateName Header section and press Ctrl+V to paste those in.
03:22Now, we'll just line them up.
03:23I'll move Lifetime Sales right about there, the LastName field, I'll move
03:28it right about there, and the FirstName one, I'm going to move that right about here.
03:34I'll move my StateName Header up and I'll align these underneath.
03:38Now, we can go through and fine-tune the alignment as we continue to
03:42further refine our report.
03:43Let's go ahead and just take a look at the functionality.
03:44But, before I do that, I'm going to take this Detail section, I'm going to make
03:48it really narrow, and we'll take a look at this in Print Preview Mode here.
03:52Now, I can see I've got pretty respectable looking report already.
03:55I mean, the fields are in the right spot, essentially I can move them around
03:58and refine the layout.
03:59But, it's giving me the results that I was looking for.
04:01I've got the StateName here, Alabama, and I've got my customers sorted underneath.
04:05So I've got Rylee Whitfield, and the Lifetime Sales.
04:08It looks like I've got this reverse though from the way I really wanted it.
04:10I wanted the highest value at the top, and the lowest value at the bottom.
04:14So I can go and change that in the Grouping & Sorting options.
04:17Close Print Preview, I'll turn on in my Design Tab, Group & Sort, we'll take my
04:22Sort by Lifetime Sales, and I'll change it here.
04:25Now, let's add a couple of other items to my report.
04:27We can add a title into the Header section here using a label.
04:30I'll click on Label, click there once to type in the title.
04:34Title for this is going to be Lifetime Sales by State. I'll press Enter.
04:38Now, I can format my title.
04:39We'll change the font to 22.
04:42I'll change the color from gray to this darker gray here to be 15% dark.
04:47I'll make this section a little bit bigger, and I'll make my textbox bigger.
04:52We can also add lines to help break up this space.
04:54I'll go to my Design Tab, and grab my line object, here.
04:59I'll add a line to the StateName Header.
05:01So every time I have a new state, I'll have a line that's marking out that space.
05:04I'll click-and-drag out a line.
05:05We'll go ahead and rearrange these a little bit.
05:09I don't necessarily need a label for the StateName, it will be obvious that,
05:11that's the StateName.
05:12So I'm going to delete the StateName label and I'll move the StateName field over.
05:17I'll go ahead, and format that, I will make it bold, and then I'll make it a
05:21little bit bigger here.
05:22I'll take these values here and I will line them up.
05:24I'll click on each of these LastName fields, all six at once.
05:29I'll go to the Arrange Tab>Size/Space>To Widest, to make them all the same size,
05:36then I'll line them up all against their left edge.
05:38So I'll select these two, Align>Left, these two, Align>Left, and these two,
05:46Align>Left, and maybe I'll move the LastName over a little bit.
05:50Okay, let's take a look at our design.
05:53Go to the Design Tab, and Print Preview, and there's our design looking up.
05:57I am going to go ahead and get rid of those boxes.
06:00We'll close the Print Preview.
06:01I'm going to press Ctrl+A to select everything.
06:04We'll go to Format>Shape Outline> Transparent to get rid of the boxes around everything.
06:09Let's take a look at the Final Layout here;
06:13Print Preview, and that's what our report is looking like.
06:15So with a very little effort, we've already got a pretty respectable looking report.
06:20By starting from scratch, we didn't have to tweak any of the pre-made pieces
06:23that the wizards tend to put-in, and we're able to make it to our specifications
06:26right from the start.
06:27In the next movie, we're going to continue building on this form by looking at
06:30the conditional formatting rules that we can establish.
Collapse this transcript
Formatting conditionally
00:00When skimming a long report, it could be pretty easy to skip right over some
00:03very significant numbers.
00:05By utilizing the Conditional Formatting rules within your reports, you can make
00:08sure that the values that were in the second look get noticed.
00:11We will continue building on a Lifetime Sales report that we made in the last movie.
00:15I'll double-click on it to open it to review where we are at.
00:18Now let's go ahead and switch into Design View.
00:20I will change my view here, switch to Design View.
00:23We want to call out some data from our report.
00:26Let's say that we wanted to highlight all of the values of Lifetime Sales
00:29that were less than $20.
00:29I will click on Lifetime Sales here, go up to the Format Tab, and click on
00:34Conditional Formatting.
00:35This will start up the Conditional Formatting Rules Manager where we can apply
00:39rules for formatting our data.
00:40I am going to click on New Rule, and we can tell Access that I want to format
00:44all the cells where the field value is less than, and I will type-in 20.
00:48For all the data that is less than 20 in the Lifetime Sales field, I want to color that red.
00:54I will click on this red button here to change the text.
00:57We will go ahead and say OK, apply those changes and OK.
01:01Let's go ahead and take a look at our report here in Print Preview.
01:04I will switch to Design View>Print Preview.
01:07Now, if I scroll down, I will see that the values that are less than $20 have
01:10been highlighted red.
01:11Now, what if I wanted to change the entire row to red, not just the number, so
01:15for instance the name as well?
01:16Well we can do that with Conditional Formatting too.
01:18I will close Print Preview.
01:19I am going to click on the FirstName box and then Shift+Click on LastName.
01:23I will return to the Format Tab and click on Conditional Formatting again.
01:26I will do New Rule.
01:28Now, this time if I were to type in the Field Value is less than 20, Access
01:32will be actually trying to compare the name, the FirstName to the value of 20
01:36or the LastName to the value of 20 and obviously that comparison doesn't make any sense.
01:40So what we need to do is actually change this from Field Value Is to
01:44Expression, and then we'll put it a calculation that compares the Lifetime
01:48Sales value to the value of 20.
01:50We can make a reference to Lifetime Sales by wrapping it in square-brackets.
01:53So I will write [Lifetime Sales]<20.
01:54I will go ahead and format this the same way with the red color and I will say
02:03OK, apply the change, and say OK.
02:06So now the Conditional Formatting of these two boxes is referencing the value
02:11that's in this box here.
02:13Take a look at it in Design View, Print Preview and now we will see that
02:16the entire row is red.
02:17Now, the expression that you can use with Conditional Formatting can get
02:20fairly sophisticated.
02:22Let's take a look at another example.
02:23It's a little more complicated.
02:24Let's say on my report, I wanted to highlight all of my top 100 customers
02:28regardless of what state they are in;
02:30some states might have none of my top 100 and some states might have four or five people.
02:33How can I get a conditional formatting that does that?
02:36Now, there's probably lots of different ways that we can go about this.
02:38If you know Visual Basic, I am sure there are another few ways you could do it there too.
02:41Let me show you one way that we can go about this.
02:43First, I need to identify who my top 100 customers are?
02:46I have got a query over here called top 100 customers, and I will
02:50double-click on that to run, and we will see that I have 100 records here, I
02:53have got the First and LastName and the Lifetime Sales and the State that
02:56these people live in.
02:57In fact, this is an exact duplicate of the query that we built our entire report
03:01off of this TotalSalesCustomers except for one minor change.
03:05Let's switch into Design View.
03:07This query is exactly the same except I've changed this return value to 100.
03:11So it's only returning the first 100 records in that report.
03:14Let's go ahead and close the query.
03:16So what I need to do in my Conditional Formatting in the report is make
03:19reference to the fields in the top 100 customers query.
03:22If the name is on the top 100, then they are going to be here.
03:25The way I am going to do that is using a function called DMin.
03:29The DMin function looks at a column of data and it finds the minimum value.
03:32One more time if I open up this query, and I find the minimum value in this
03:36Lifetime Sales field, it's going to be here at the bottom; $135.08.
03:42With DMin, I can use this value and use that as a comparison in my
03:45Lifetime Sales report.
03:47If I find any values that are at that value or above, then by definition,
03:51they're my top 100 customers.
03:53So how we would build that query?
03:54Let's go ahead and close this Print Preview.
03:56I'm going to go back to the Format Tab>Conditional Formatting.
04:00I am going to say New Rule, and let me point out real quick here.
04:04If I were to actually select all three of these at the same time, and do a New
04:07Rule at the same time, since they have slightly different conditions at this
04:10moment, they would actually wipe out the first one.
04:12So because these first two have the same condition, I could add another one,
04:16and it would be just fine, and then I will just copy that to this third one
04:18over here, but again if I were to highlight all three at once, it would
04:21actually delete the first condition and it puts in the same condition for the other three boxes.
04:25So that's why I have been doing this in two steps.
04:27So we'll do a New Rule here.
04:30This time I am going to do Expression.
04:31I am going to make reference to that same Lifetime Sales field here in the
04:35report, then I am going to wrap it in square-brackets.
04:38Now I want to say this value if it's greater than or equal to the DMin, I am
04:42going to open up a parenthesis for the function, and now I need to make a
04:46reference here this top 100 customers field.
04:48Now DMin, like all of the other domain aggregate functions like DAverage or DSum
04:53has a slightly different syntax than you might be used to.
04:56In order to make reference to those values, we wrap them in quotation marks.
04:59So write a quotation mark, and then a square-bracket, the name of the field that
05:03I want which is Lifetime Sales in my top 100 customers field, the closing
05:07quotation mark, a comma, an open quotation mark, another square-brackets, and
05:12then the name of the query I will find that field in;
05:14qry_Top100Customers.
05:18I will finish it with a closing square-bracket, a closing quotation mark and a
05:23closing parenthesis.
05:24Now, I can format this how I want.
05:26For these values, I am going to highlight them with this light purple, this
05:29Purple 3 color, and just so I have this on my clipboard, I am going to copy this
05:33so I can paste it on that other value.
05:35So copy, I will press Ctrl+C, so it's stored.
05:38Go ahead and say OK, and Apply.
05:41Now I will say OK again.
05:42Then we will apply that to our Lifetime Sales condition as well;
05:46Conditional Formatting>New Rule> Expression Is, and now I will paste that in. Okay.
05:51Let's go ahead and see if those works.
05:53I am going to say OK, OK, except I need the change of the coloring, so I will go
05:58back to Conditional, I will double-click on it, and I will change that
06:02background color to Purple 3. All right!
06:03That looks good, say OK here.
06:06We will go to the Home Tab, and we will view the Print Preview.
06:09It's going to take it a minute to process, but now I have got the purple
06:12highlighting for my Top100Customer here, and I have got the red highlighting for
06:16everybody that's below $200.
06:17It looks like Alaska has a whole bunch of our top 100 club.
06:22Now I can clean this up a little bit more.
06:23Right now, the purple coloring is just where the textbox is, and if I want to
06:26make this look like it's highlighted all the way across the row, I just need to
06:29make the textboxes wider.
06:30We will close Print Preview, back in Design View and I will just make
06:34these textboxes wider.
06:38If they overlap a little bit, that tends to help without any white lines
06:41appearing sometimes between them.
06:42So I will change my view to Print Preview, and now I have got a purple bar that
06:46extends all the way across for my Top100 club customers.
06:50So using Expression Builder and a bit of logical problem solving, the
06:53Conditional Formatting rules can highlight just about any records that you'd
06:56like to call special attention to.
Collapse this transcript
Calculating fields
00:00We've seen how report stay connected to a data source through the record source
00:03property, which is linked to either a table, an embedded query or in the case of
00:07our lifetime sales report a linked query.
00:09But we can actually calculate additional values right here inside of our Report
00:13using unbound text boxes, let's go ahead and right click on our Lifetime Sales
00:17report and open it straight into the Design View.
00:19What I would like to do is add some calculated fields that add up the number of
00:24customers inside of each state and then adds up a total value that each state is
00:28brought to the company, we can do that with two text boxes and we could do that
00:31in a site footer section.
00:32We'll go up to our Group & Sort button here on the ribbon, I'll turn that on and
00:36for StateName where it say More I'll open that up and over here on the right,
00:41right now it says without a footer section I click the down arrow and change
00:44that to with a footer section.
00:46That'll add a new section here called StateName Footer that will appear after every state.
00:51Now I can put my calculated field inside of this box, I'll go up here to Text
00:55Box and I'll add two text boxes into the StateName Footer section, I'll click
00:59once and add one in and I'll click second time and add a second one over here
01:03under Lifetime Sales.
01:04I am going to go ahead and change the labels associated with them now, I'll
01:08double click on this first one and this first one I'm going to type in Numbers
01:11of Customers followed by colon
01:14and in the second one I'll double click and type Total Sales followed by a colon.
01:19Let's go ahead and arrange these into position, I'll click on all four and I
01:25will go up to the Arrange tab>Align>to Top.
01:30Now I will just space these out a little, I'll deselect them and I'm going to
01:33move this label over using the handle here and I'll move Total Sales closer to this box there.
01:42Now I'll right align these two labels so that they appear against the text box
01:45go to Format>Alignment>Right.
01:49And finally I want to align these underneath the values above, so I'll move this
01:53over here and this one looks about right there, okay.
01:58The next thing I want to do is change the calculation that'll appear here in the box.
02:02For each text box we can go to the Data tab of the Property Sheet and type in the value.
02:07We can either type the formula right here if we know it or we can use the
02:10build button here to open up the Expression Builder that'll help us construct the expression.
02:15So this first box is going to add up the total number of customers, we can do
02:18that with the counting function.
02:19If you want to find it here we can find it in the Functions folder, Built-In
02:23Functions, scroll down to the SQL Aggregate group>Count, I'll double-click to
02:28add that to my Expression up here.
02:30The next thing you want to know is, well what are we counting?
02:32I'll click in the Expression, close that up, I'll go into my report here, I'll
02:37do under the Access database Reports> Loaded Reports the Lifetime Sales report
02:43and I'll just add up the number FirstName, I'll double click on that to add it
02:46up here, we'll go ahead and say OK.
02:48So that adds that calculation here into the box of the Control Source.
02:52Let's go ahead and do another one for this one the Total Sales that'll add up
02:55the Lifetime Sales across the state, we'll click here and this time we'll just
02:58type in the value there is a pretty simple formula it's going to be a sum, so
03:01we will say =Sum open parenthesis, open square bracket
03:06Lifetime Sales with space closing square bracket and closing parenthesis,
03:12go ahead and press Enter to finalize that and we'll take a look at our report.
03:16Go Home change our View to Print Preview.
03:20After a moment the report runs and I can see I've got these two calculated
03:23fields now, I've got the Number of Customers in each state and the Total Sales
03:26for each state before it starts the next state.
03:28Let's go ahead and clean this up a little bit I want to make these things align
03:31and get rid of this text boxes, so I am going to go back to Close Print
03:34Preview, I'm going to highlight both of these go to my Format>Shape Outline and Transparent.
03:41Now I'm going to make sure that these are all align properly look like the
03:44number is here we are formatted a little bit to the right, we'll just format the
03:47Lifetime Sales and summary calculation to the right.
03:51And finally I want to create the size of the footer a little bit we'll change
03:56it's background color using the paint bucket here and I'll change it to a little
03:59green color, it's Olive Green, Accent 3.
04:03And maybe I'll add a line across the top to denote that this is the footer
04:06section we have moved on from data, I'll click all four of these boxes by
04:10Shift+Clicking moving down a little bit, we'll go to the Design tab and I'll
04:14add a line object here.
04:15Now I'll add a line right across there and I move it up so it's tight against
04:21the section, go to Home change the view to Print Preview and there is our boxes.
04:27So calculating controls can be pretty straightforward and the Expression
04:30Builder can help you construct the formula for any of the functions available
04:33within Access.
Collapse this transcript
Adding the finishing touches
00:00No report should be complete without those finishing touches that make for a
00:03polished presentation thing such as page numbers, date and time stamps and logos
00:07help present a professional looking document.
00:10In this movie we're going to finish up our Lifetime Sales report by adding
00:13these elements, we're going to go to our Lifetime Sales report and right click
00:16and go into Design View.
00:18We can add a few things here with the Page Number or a Logo, Title or Date and Time.
00:23Now the Logo and Title objects automatically coming formatted and I prefer to
00:27have the finer control that just a standard label or for our logo standard image
00:32provides, so I'm going to actually not use these two I'm just going to use an
00:35image, we have already got the label in for our title.
00:37So let's go ahead and add a logo, I'll click on the Image box I'll drag out a box here.
00:42Access will open up the Insert Picture window and I'll go to my Exercise folder,
00:47Chapter 5 and I'm going to choose the TwoTrees logo, press OK.
00:51That'll put it into my report, I am going to go ahead and move it over to the
00:54right side, I'm also going to take my title here and I'm going to align it up
00:59with the left side of my text here the StateName.
01:02Now let's change to the background color of the page header.
01:04I'll click on the background here and that'll take me to the PageHeaderSection
01:07of the Property Sheet.
01:09The background color right now is this Background 1, I'll click on the Build
01:13button and then I'm going to go the More Colors, so I can type in the value that
01:16matches my logo I'll click on More Colors>Custom and I'll type in the value of
01:21the green, its 185 for Red, 198 for Green and 170 for Blue, go ahead and say OK
01:28and that will color the background.
01:30Now I can see that I've got a background color actually applied to this image as well.
01:32So when we click on that we have got background color it's currently set to this
01:36white here and I can actually just make a Transparent by clicking Back Style
01:39above and changing it to Transparent.
01:41You can also go to Formatting and make sure that doesn't have any outline we go
01:44to Shape Outline and Transparent.
01:47So that's add a logo to the top right, I have got my title in top left, let's go
01:52back to the Design tab.
01:53You can also add page numbers to my report by clicking on the Page Numbers button.
01:56And we go ahead and click that and I get a little wizard that pops up that ask
01:59me how I want to format these.
02:01So I can use the single page number or I can say page number of however many
02:05pages are in the report.
02:06I'll just choose the single number.
02:07You can also choose where to put it, in the top, in the page header or in the
02:11bottom in the page footer.
02:12I'll choose Bottom, go ahead and say OK and it adds calculated unbound text
02:17field just like we calculated up here that calculates the page number there.
02:20Let's go ahead and add a date and time stamp, I'll click Date and Time right here.
02:25Access again ask me how I want to format it I could use a full date or I could
02:29use one of this abbreviations, I'll just choose the full date and I can choose
02:33whether I want to include time or not and what format.
02:35I am going to turn the Time off and just include the Date, go ahead and say OK.
02:39Now Access doesn't ask us what we're going to put it, it just automatically puts
02:42it in the Report Header section and if I close the Property sheet you'll see
02:45it's right over here.
02:46Now I can actually copy it and put it wherever I like, so I'm going to select it
02:50press Ctrl+X that'll cut it and I am going to come back down here into my Report
02:55Footer and I'll place it down at the bottom on my report instead.
02:57And I'm going to go ahead and move it all the way over to the right like so.
03:02I'll scroll back up to the top we'll get rid of this report header that was
03:05added just by shrinking it up. Oh!
03:06There is a box actually in there I need to delete that out, now I can shrink it.
03:12See what happens when Access add things for you.
03:14Few last-minute details that I want to attend to.
03:16The report actually got wider when I put in this date field, so I'm actually
03:19just remove this logo over so it stays in the corner, I'm also going to change
03:23the background color of these two boxes.
03:25Instead of being white on top of green I'm going to make them transparent, so
03:27you can see the green through it, I'll select both of them by Shift+Clicking on both.
03:32Format tab>Shape Fill>Transparent, you could also check it here in the Font
03:37field, I also want to move this line here it's above my StateName I'm going to
03:41move it up one square, just pressing Up on the keyboard and that'll kind of
03:44tighten that up against the state header name.
03:46And everything else I think is looking okay, let's go ahead and scroll through.
03:50Well I think I want to change the color of the state, it look like it's going to
03:53print blue, I actually don't want that and I can make it match this page number
03:56in coloring by using the Format Painter here.
03:58So I'll select the Page Number, go to that Format Painter and then apply that to
04:03the date as well, and now I will select the date and I'll right align it again.
04:06Now I think that's looking okay, let's go ahead and go to check it out in
04:10Print Preview mode and here is my report, its looking okay, got some color
04:16going on down here in the bottom I've got my columns tilted up, got the
04:20calculations showing.
04:21Now I've got my conditional formatting that have picking out my top 100
04:24customers throughout the whole company.
04:27So now that the report is finished we can go ahead and send it to the printer or
04:30save it as a PDF file email it out or just save it in our database.
04:34Every time we open it it's going to go back to the data fetch the current
04:38snapshot of our business and it's going to update each customer spend,
04:41reevaluating the conditional formatting and the top 100 customers list, and it's
04:45going to give us an up-to-date information in a presentation ready format.
Collapse this transcript
Populating pre-printed documents
00:00We've been hearing of the so-called paperless office for quite some time now,
00:04but that promise is yet to become a reality.
00:06There's just no getting away from having to fill in paper documents sometimes.
00:10Luckily with a little planning and help from Access we can streamline some of
00:13the process when it comes time to filling in preprinted paper documents and
00:16forms with information from our database.
00:18For this exercise we'll look at populating information about our employees into
00:22a preprinted government employee form such as this form i-9.
00:26The first thing we need to do is get an image of our preprinted document.
00:29We can get this image in a number of ways;
00:31you can scan it in using a scanner or export it from a PDF file.
00:35However you do it for the best printed quality you should capture your image at
00:39300 pixels per inch.
00:40It's also important that it's not scaled.
00:43Next, we need to prep this image a bit to overcome what I consider to be a bit
00:46of a quirk with Access reports.
00:48In Access you can't set page margins to zero, so if we put an image of our
00:52document that's exactly the same size as our printer paper Access will try and
00:56wrap that image on the multiple pieces of paper.
00:59To overcome this we need to crop down our image, a quarter of an inch on all sides.
01:04So our final image will be 8"x10.5" at 300pixels per inch this works out to
01:102400pixels x 3150pixels.
01:14Then when we import the image back into Access it can accommodate those
01:18quarter inch margins.
01:19Now if you need additional resources for image preparation, you can find them
01:23here at Lynda.com, in the course of Scanning Techniques for Business and Home,
01:27or Acrobat X Tips and Tricks.
01:29Now once we have a preprinted document in it, it's time to get started in Access.
01:33Now back in Access we can start building our i-9 report .We go up to the Create
01:37tab, we will do a new report in Design View.
01:40First let's go and get rid of these page headers.
01:43I'll right-click on this Detail bar and turn off the Page Header/Footer.
01:47Next we'll double check our margins.
01:49I'll go to Page Setup and make sure our margins here are set to
01:52quarter-inch, which they are.
01:53Then we'll go ahead and set up this Detail section to accommodate the image.
01:58Under the Property Sheet for the Reports I'll go to the Format tab, let me go
02:02ahead and set the width of my document to 8 inches.
02:06Up here in the Picture I'm going to click where it says None, and I'll click the
02:09Build button to select the image.
02:11We'll go out to my Desktop>Exercise folder, Chapter 5 and then I've got my i-9
02:18Cropped image that's already been prepared.
02:20I'll say OK, I'll change my Picture Size Mode from Clip to Zoom, and then I'll
02:27set the Detail section height.
02:29I'll click on the Details here and then I'll change the height here to 10.5.
02:35Now that background is set up, we can go ahead and start adding our fields.
02:38We'll go to the Design tab and we'll turn on our Add Existing Fields window.
02:42We'll click on Show all tables, the Employees table, and then we'll start adding the fields.
02:46So I want FirstName, now let's double- click to add them, LastName, Address,
02:51City, State, Zip, and we're going to need the middle name as well.
02:57But we'll have to convert to it to initial and we'll do that in just a moment.
03:00So I will just have the MiddleName.
03:02Okay, now Access moved all these with labels associated and I don't need the
03:06labels because we're putting this on a form that already has labels, so we can
03:09go ahead and get rid of all of these.
03:10So I highlight all the labels here in the left side, we'll get rid of those,
03:14I'll press the Delete key, and for the purpose of the exercise I'm going to
03:17go ahead and color my font right now, I'm going to make a big, bright, bold,
03:20red, so you can see it.
03:21We go to the Format tab;
03:23I'll change it to Red, Bold, okay.
03:27Now let's start moving them into position.
03:28On this report it goes LastName and then FirstName.
03:31We'll take the LastName and I'll drag it there.
03:34First name is going to go over here.
03:36MiddleName will go over here, Address is below, Address with the City, State, and Zip.
03:45Now we can work on the alignments a little bit, I'm going to move the Address up
03:50just a little bit here and make it wider.
03:54The City, I'm going to make wider as well, the LastName and the FirstName I'll
03:59make wider just to make sure I don't have any long names to get off.
04:01And then actually I'm going to move them up a little so they don't overlap the line below.
04:06Next, I'm going to highlight all of these and make sure they have a transparent
04:09background and no border.
04:10So in the Format tab, we'll do Shape Fill>Transparent, Shape
04:15Outline>Transparent.
04:17Okay, the last thing I need to do is format this MiddleName, right now
04:21it's showing the whole MiddleName whereas the form is just asking for the Middle Initial.
04:25Let's switch to the Design tab and open the Property Sheet.
04:27I'll click on the MiddleName field here and we'll look at the All tab, now I can
04:32and change with the MiddleName textbox displays with a formula, but first I need
04:36to change the name here.
04:37If I change the formula first then the name will create a circular reference,
04:41because it will think I'm referencing itself instead of referencing the field
04:44from the original table.
04:45So I'm going to change the name of this textbox here to Middle Initial, then I
04:52can change the Control Source.
04:53So instead of just MiddleName I actually want to use a function.
04:56I'm going to right-click in this box and say Zoom, so I can have some room to type.
05:00I am going to change the font here, so it's little easier to see.
05:04The function that I can use to extract just the first letter for the MiddleName
05:08is called the left function.
05:09So what I'm going to do here is write = Left, open a parentheses, type in a
05:14square bracket and then move to the end. Close the square bracket, comma
05:191, and then close parentheses.
05:22So now what happens is the Left function is going to extract the one of the
05:26first left character from the MiddleName field.
05:29We'll go ahead and say OK, and I'm going to make sure that's Right Aligned so
05:32it's again at the right-side here.
05:33I'll go to Format and make that textbox right aligned.
05:37Alright, let's go ahead and check it out.
05:39Go to Design view>View>Print Preview, and take a look at our form.
05:44I can see that the text that is lining up in the boxes pretty well, I might want
05:48to adjust the spacing a little bit, but more or less it's looking pretty good.
05:52Now the display under the screen looks a little bit chunky and that's just
05:55because of the way it's rendering this zoomed out view.
05:58If I go and view this I would say like 200%, we'll see the text looks a lot
06:02sharper and it'll print a lot nicer than it looks from the screen.
06:05We also have two options when it comes times to print this.
06:07I can either print this document as is, and I will print the report in the
06:11background and the data at the same time or if I actually do want to print on a
06:15preprinted piece of paper, I could go back and delete the image from the
06:18background of this report and print just the data, and it should line up just
06:22right on the paper, so there we go.
06:24It's how we can setup our Access database to help us print on the preprinted
06:27reports and documents.
06:29With a little ingenuity and some time spent in the Design View we can get
06:32everything lined up just right.
Collapse this transcript
6. Printing, Tweaking, and Automating
Printing reports
00:00We've seen the Print Preview screen many times throughout this course, but we've
00:03never really stopped to take a look at the ribbon.
00:05Let's go ahead and open up our Lifetime Sales report in Print Preview by right
00:09clicking on it and saying Print Preview.
00:10Now most of these buttons are going to be pretty obvious in what they do.
00:14We can change the size of the paper or set its margins, I can change from
00:18Portrait to Landscape paper.
00:20These changes however would alter the layout on our report.
00:23For instance, if I switch to Landscape, Access will redraw the report on the new
00:26page but it doesn't actually take advantage of the space over here on the right.
00:29If I wanted to make this a landscape report;
00:31I'd want to go back in the Design View and reorient my page so that I can take
00:35advantage of the extra space.
00:36Let's go ahead and switch it back to Portrait.
00:38I also have an option here for Columns, but again you would have to set up your
00:42report specifically for columns in order to best take advantage of this.
00:46Let's go ahead and take a look at one that I've already set up.
00:48I'm going to right-click on Lifetime Sales Columns and choose Print Preview.
00:53This report, I have set it to be only 4 inches wide, now I can go to the Columns
00:57setting here, select Columns, and choose the Number of Columns to 2.
01:00I am going to accept this layout here where it goes down and then across rather
01:05than across then down.
01:06So I will leave down then across, and say OK.
01:09Access will redraw the report and now you can see that it starts with Alabama
01:13which ends here, then goes to Alaska data which goes down to the bottom, starts
01:18again at the top and then ends down here before starting Arizona.
01:21Now the multicolumn report might be confusing to some users because they might
01:25think that the data for Alabama for instance is the data over here in the left
01:29and this data over here on the right.
01:31So depending on your data I'll leave it to you to decide whether this is a good
01:34format for you or not.
01:35Let's go ahead and close this report, we will go back to the other one.
01:39This Zoom section here allows us to view multiple pages at a time.
01:42I can choose this view a Two-Page spread or More Pages than that.
01:47I can zoom out to different zoom levels.
01:48And then over I have a Data section, the Data section allows me to export my
01:53report to different file formats.
01:54For instance an Excel file or PDF file, or I can attach it as an E-mail
01:58attachment and I have some more options here in the More section.
02:02Some of these file formats will strip out all of the formatting and
02:05coloring that we have.
02:06PDF file will keep out of it but it won't be editable, and finally on the far
02:09left we've got the Print button.
02:11We can click that, choose a printer, and send it off.
02:14Technically you can also print forms too, but you're not going to find Print
02:17Preview in the View menu for a form, for instance if I close this Print dialog
02:21box, I'll go to one of my forms here, I'll go to the Employee Directory if I
02:25double-click on it to open.
02:27I don't have a Print option up here, but if I go File and then Print I can
02:32choose Print Preview from here.
02:34In some forms like this Employee Directory would actually work pretty well as a
02:37printed document, but that shouldn't really be the primary use for forms.
02:41Reports are made to be printed and exported.
02:43We can use them as a screen-only presentation but that's really what forms are for.
02:47Reports like some of the features on screen that you would expect, such as being
02:50able to filter or page through records.
02:52On Screen and Report View reports become exceedingly long and endless scrolling
02:57list of records which really isn't that user friendly.
02:59So if you stick to the rule that forms are for the screen and reports are for
03:03paper it'd be a much happier database designer.
Collapse this transcript
Tweaking the design
00:00At the end of Chapter 03, we took a look at connecting a user input form to a
00:04query which then passed data onto a Chart Object.
00:07We can do the same thing with a Report.
00:09I've got a workflow setup here called SalesByDivision;
00:11I am going to start with a SalesByDivision form here.
00:14I'll double-click on it to open it and I'll see that this form is asking me for
00:18a Geographical Division and a Year and I want to compare it to another
00:21Geographical Division and Year.
00:23Let's go ahead and fill in some boxes.
00:24I'll use the drop-down menus and choose I am interested in the New England
00:28Division for 2009 and now I want to compare that data to the Pacific Region for 2009 as well.
00:36Now I've got two buttons here as well.
00:38I can either Run the Query or I can Preview a Report.
00:40Let's go ahead and press the Preview Report button.
00:43I'll press Preview Report and the report generates, showing me New England for
00:482009 and here is the states and data and then if I scroll down, at the Pacific
00:53States 2009 with their states and data.
00:55I also have some calculated fields to the very bottom.
00:58Both this form and the report have had their designs refined quite a bit.
01:02So in this I want to dissect these elements to see how they were designed and
01:06some of the decisions that were made to get them to this point.
01:09We'll start where the user starts with the form.
01:10I'll go ahead and close the report here and we'll take a look at this form in Design View.
01:15I'll switch to Design View here and we can see a couple of things on this form.
01:19First, there really aren't all that many elements.
01:21In the top left corner I have this logo and the bottom of the logo is a kind of
01:24a brown color and the top of this logo has this green color.
01:28I've put it in the top left corner of my form and in the top of the form
01:31I've put a rectangle.
01:33The rectangle is all of this area here in the orange.
01:35The rectangle color is set to the same green as my logo.
01:38The background of the details section of my report is set to the same color
01:42as this light brown.
01:43Down in the bottom right corner I have a tree image.
01:45Again we're using the same light brown color for the background of that tree picture.
01:49Let's also take a look at this tree, if I click on it and go to the Arrange tab
01:53and take a look at it's anchoring here, we'll see that it's set to anchor to the
01:56bottom right corner.
01:57That means that no matter what size of screen the end-user is looking at, that
02:01tree image will always appear in the bottom right corner of their screen.
02:04At the top, I have a label.
02:06It's just been bolded text and set to white.
02:08And then I have my elements down here.
02:10I've got a couple of command buttons and I have some combo boxes.
02:14Let's take a look at these combo boxes and I am going to go to the Design tab
02:17and turn on my Property Sheet.
02:18Let's click on the first combo box here.
02:21On the All tab, I'll see that this combo box has a name cbo_division.
02:26The box below it has a name as well, cbo_CompDivision.
02:30My Year boxes, they have names as well, cbo_Year and cbo_CompYear, so we can
02:36make reference to whatever the user selects here in our query later.
02:39So let's see where the data is coming from for these drop-down menus.
02:42I'll click on the first one again and go to the Data tab.
02:46The Row Source is this SELECT query right here.
02:48Let's take a look at the query behind it.
02:50I'll press the Build button and we see that there is a pretty simple query,
02:53it's pulling in information from my States table and I've got my DivisionName
02:57and the DivisionID.
02:58I can also see that I am sorting on the DivisionID ascending, but I am not
03:02showing it in the list, so why do I have this part here?
03:04Well let me run the query and you could see.
03:06So when I run the query, I'll notice that my DivisionNames are listed in
03:10geographical order, not alphabetical order.
03:13And this is important for my end-users.
03:14This might be the order that they're more comfortable seeing this data presented in.
03:17Let's go ahead and go back to Design View.
03:20And I'll close the query here, we'll take a look at the Year box, it has a Row
03:25Source as well, it's also a query, these are embedded queries.
03:28I can click the Build button to see its details and this is simply pulling out
03:32the Order Date from the Orders table and applying the Year function to it.
03:36So when I run it, it's just getting a list of Years that are available within my database.
03:41I'll close this out and take a look at the query now.
03:44So I've got the names of these boxes that the end-user selects.
03:48Close out the form, and I am not going to save any changes.
03:51When I click on those buttons, the query runs.
03:54The query that runs is this one right here, the qry_SalesByDivision, I'll
03:58right-click on that and take a look in Design View.
04:01I'll close the Property Sheet here so I could see the whole thing.
04:04And this query is made up of four different tables;
04:06Products, Orders, Direct Customers, and States.
04:09And then down here in the Criteria, I right-click on this and say Zoom, we'll
04:13see the text of that Criteria.
04:15The Criteria for the Year field for instance is reading to pull the year
04:19from the combo box year on the SalesByDivision form or the CompYear from the
04:25combo box on the form.
04:26Go ahead and say OK to that, we'll take a look at the other one;
04:30I'll click here, right-click and say Zoom.
04:34The Criteria for the DivisionName is also coming from the combo boxes on my
04:38form, the cbo_division or the cbo_CompDivision.
04:42So if it matches either of the selections from the form, it will show up in the query.
04:46Go ahead and say OK and I'll close the query, without saving any changes.
04:52The next thing that happens is that the report opens.
04:54This is the report down here, rpt_SalesByDivision-complete.
04:59I'll right-click on it and switch to Design View.
05:01First we'll go to the Property Sheet and take a look at the Record Source for this report.
05:06I can see that it's a linked query, it's linked to that query we're just looking
05:09at, the qry_SalesByDivision-complete this is where the data is coming from.
05:13It's split into a couple of sections;
05:15I've got the Report Header here with the title.
05:17The Division Header Name that will show the division every time, the Year Header
05:20below that, a Detail section, the DivisionName Footer and scrolling down I've
05:26got a Page Footer and a Report Footer.
05:28Now each of these boxes have some interesting properties, for instance this
05:32SumOfPrice right here is the data that's coming from the query.
05:35Down below that in the DivisionName Footer, I've got another box here that
05:39says Division Sales;
05:40this is calculating the total sales.
05:42And it says equals Sum of SumOfPrice (=Sum([SumOfPrice])).
05:45So it's adding up all of the fields here in the SumOfPrice column.
05:49But down below that in the Report Footer here, I've got another box and when I
05:53click on that I see that it has the exact same formula =Sum([SumOfPrice]), this
05:58one is getting the total value of the entire report.
06:01Because it's in the Report Footer section, it's aggregating over the entire report.
06:05Because this one is in the DivisionName Footer section, it's aggregating over
06:08the division name section.
06:09So let's go ahead and close this report and we'll run through that workflow one more time.
06:13I'll double-click on the form to open it;
06:16I'll choose an area of interest.
06:18How about this time East South Central for the year 2009 and we want to compare
06:23it to the same section for 2008?
06:25We'll Preview the Report and that will open up in Print Preview mode with the
06:30data that I'm interested in.
06:32So the only thing different is between this and some of the forms and reports
06:35that we've created in this course is the amount of time spent fine-tuning the
06:39position of the elements, adjusting the colors and fonts and I'm going to admit
06:42it, sometimes obsessing over every single pixel.
06:45Step one in creating your forms and reports should always be to get the
06:48functionality in place.
06:50If the form or report is exceptionally ugly, once it's functioning properly, all
06:54the rest is just moving the pieces around.
06:56And that part can take a while as you change your View Mode back and forth
06:58between Design View, Layout View and Form or Report View, sometimes moving
07:03elements one step at a time.
07:04It can be tedious sometimes, but the end result will look great and
07:08function great.
Collapse this transcript
Automating the workflow with macros
00:00Before we wrap up this course, I thought it will be helpful to outline a
00:03couple of the macros that you can build that will help you connect your forms to your reports.
00:07As we have seen in several places throughout Access, sometimes the wizards only
00:11present you with the most common options.
00:13To get access to all the available options, you will need to dig into the designers.
00:17The same applies to the button wizard.
00:19The actions available in the button wizard only give you a few basic options, to
00:23move beyond that, we need to construct macros ourselves.
00:25So let's add some of these reports that we have created in the last two
00:28chapters, to the Main Menu that we created earlier in the course.
00:31I will right click on the Main Menu and switch into Design View.
00:33We will go up to that Button command and we will add a button to our form.
00:37I will click here to add it and I'm going to go to Report Operations.
00:41The first one I want to do is Mail Report.
00:43I will go ahead and say Next.
00:45The report I want to mail is that Orders By State, I will go ahead and click Next.
00:49And for this button I wanted some Text on here.
00:51I'm going to put Email Orders Report, go ahead and say Next, it will accept that
00:58name and say Finish.
00:59So there's one button.
01:00Let's go ahead and add one more.
01:02I will click on the Button control and add that down to my form, the wizard will
01:06start and I am going to go to Report Operations again, and this time I am going
01:10to choose Send Report to File.
01:11Go ahead and say Next, the report I want to send is my Lifetime Sales report.
01:15I will click on Lifetime Sales and say Next.
01:19The text for this instead of just Report to File, we will say Export Lifetime Sales.
01:23Go ahead and say Next and Finish.
01:27So now I have got two buttons here, well let's take a look at what the
01:30wizard made for us.
01:31I will click on this first one the Email Orders one.
01:34We will go to the Event tab here.
01:36The On Click event is this Embedded Macro and I will click the Build button to edit it.
01:40I will see that the wizard created this macro for us that that includes this
01:43EmailDatabaseObject action.
01:44It filled in a couple of these options for us, for instance, I have the option
01:49to include a report in the Orders By State report.
01:52But I also have some additional choices.
01:54I can specify an Output Format.
01:56And if I click on this, then the drop-down menu here I can choose a specific
01:59file format so that Access doesn't ask me every time I press the button, what
02:03type of file I would like.
02:04I am going to choose PDF.
02:06I can specify a recipient so I could type in the To box here.
02:09And I am just going to send this to Test@test.com.
02:13I can specify carbon copy or blank carbon copy recipients, I can type in a
02:17subject here, Here is the Orders by State report.
02:22And I can add Message Text in to the body, The report is attached.
02:26This last one here, this Edit Message one is currently set to Yes.
02:31If I leave it set to yes and press that button, Access will take this report, it
02:35will convert it to a PDF file.
02:37It will open up Outlook on My Computer, it will create a new e-mail, address
02:41it to this person, put in the Subject line and the Message Text, and attach that PDF file.
02:45And then it will sit there and wait for me to send the email.
02:49If I change Edit Message to No here, when I click on that Send Email button on
02:55my Main Menu, all of that will package up, get attached to the email, get
02:58addressed and it will be send off with no further interaction on my part.
03:02So I won't even see that email go out, it will just be gone.
03:04Let's go ahead and change that back to Yes.
03:06So I don't accidentally send any emails.
03:07We will go ahead and close this and we will save the macro.
03:10So now that macro is providing more functionality than what the wizard gave for us.
03:15Let's take a look at the other one, this Export Lifetime Sales.
03:19The On Click event is this Embedded Macro again.
03:21We will look at the builder for that.
03:23This macro includes the ExportWithFormatting action, and again I have got a
03:27couple of options filled in.
03:28If I click here, I can select some additional options.
03:31Once again, I can specify a file format.
03:34Maybe I want to export this in a Excel file.
03:37I can also specify an Output Location, so if I want to specify an archived
03:41folder on a network or some place on my local computer where I always want to
03:44save it, I could type that in here, so Access won't even asks me for it when
03:47I click the button.
03:48It will just put it right in that spot.
03:50I am going to leave it blank for now, and click close.
03:52I will save the changes, so again, now this button is doing something more
03:56useful than what the wizard left us off with.
03:58Let's go ahead and format these a little.
04:00I will click here and here, we will go to Format, I will change their Quick
04:04Style to maybe this black and we will go ahead and Arrange them.
04:08I will Align them to the Left side, I will take their spacing and Decrease
04:12Vertical and maybe a couple of times.
04:15That's actually going to take too long so I am going to press the button move it up here.
04:21Now I will select both of them and maybe I will drag them down here.
04:24So now I have got a couple of additional buttons that I have added to my Main Menu.
04:28I can go take a look at it.
04:30I will press to switch to Form View and now if I press this Email Orders Report
04:34button, we will see what happens.
04:36The order gets packaged up and in just a moment, we shall see Outlook pop-up,
04:40there it is, my email is formatted, the file is attached and it's ready for me to press Send.
04:44So while using the Button Wizard, was able to get us started, digging into the
04:48full macro editor, was able to provide further functionality.
Collapse this transcript
Conclusion
Next steps
00:01I want to thank you for joining me here in Access, and I would like to leave you
00:03with these parting thoughts.
00:05Form and Report design in Access is one of those areas that really is
00:08interdisciplinary, and you can pick up a helpful idea on how to structure your
00:12content in the most unexpected of places.
00:14Start paying close attention to the experience you have completing forms on the
00:17Internet or interacting with the screen on an ATM machine.
00:20If you find an unusually well laid out financial report, take a few minutes to
00:23pick it apart and figure out what really works about it.
00:26Inspiration on how to create a better interactive experience for end users,
00:29literally is all around you.
00:31I would like to recommend a couple of additional lynda.com courses that can help
00:34you build on the core concepts of user interface and would apply to what we've
00:38seen here in Access.
00:39The first is Web Form Design Best Practices.
00:42That course covers the importance of understanding user behavior and form organization.
00:46The second course is Typography for Web Designers, which explores the
00:50fundamentals of organizing text for increased clarity in organization.
00:53Until next time, thanks again and have a fantastic day!
Collapse this transcript


Suggested courses to watch next:

Access 2010 Power Shortcuts (3h 43m)
Alicia Katz Pollock

Access 2010: Queries in Depth (3h 2m)
Adam Wilbert


Setting Up a Database in Excel (43m 27s)
Dennis Taylor

Managing and Analyzing Data in Excel (1h 32m)
Dennis Taylor


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,141 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked