In this video, learn how to add reports that you can run from a form.
- [Instructor] It's important that once you start building navigation that you add all your reports and set your appropriate options. You'll want to ensure everything is accessible through navigation. Let's look at refining our navigation forms. We have a query in our database called orders by customer. Let's right click and take a look at the design view. It will ask our end users for the customer name, and it's pretty flexible because it contains those wild cards, so they don't have to have the full customer name, they just have to know part of it.
It also allows us to filter by the start and the end date. It's a little bit different than our other report because it includes required date and ship date. We want to make sure this is available through the report navigation. Let's go ahead and close this query. Let's go to the report nav, right click and choose the design view. Okay, let's go ahead and add a label. Drag that out on our report nav form. I'm going to label it look for orders, and then we're going to create a button that will prompt us for orders by customer.
On the design tab, I'll use my command button. I'll draw it on the screen, I'll go to the miscellaneous category, I'm going to run a query, the query I want to run is orders by customer, I'll choose next, I'm going to change the text. I think I'm going to call this run orders. Call this command button run orders.
Then I'll choose finish. Let's save our report navigation and let's go test it out. I'll choose run orders, I'm going to type diner. Click OK, and I want to see orders between 1/1/2016 and 12/31/2016 and then it gives me my diner corp orders in year 2016, perfect.
I'll go ahead and save this and close it. Let's go to the nav form. The nav form is the very first form that opens in the database. We need to add the ability to get to the report navigation from the nav form. I'm in the design view of the nav form. I'm going to go click my command button. Again, super easy, we can just use the wizards. It's a form operation, we're going to open a form. The form I'm going to open is the report nav.
Going to change it to run reports. I'm going to name it cmdbtnRunReports. I'll go ahead and size it out to match my button above it. Perfect, I'm going to go ahead and save, go to my form view, test it out. I'm going to go ahead and save and close my report nav.
I'll click run reports, and then perfect. I can go run my reports, set my dates. Now, we need to add a return to nav button which is technically just closing the report nav. Let's right click on the report nav tab and go to design view. Close buttons are super easy to do. I can click my command button, I'll place it on the top right of my screen. It's a form operation, I want to close the form.
I'll choose next, now I'm going to change it to read return to nav. It'll technically close the form, and because the navigation form is still open, it will appear that it's returned to nav. I'll do next, call this command button return to nav, and then I'll choose finish. Even though we're using the command button wizard, it's actually coding in the background for us.
I'll go ahead and right click and choose save, and then I'll go to my form view, and then I'll return to nav, perfect. Now I'm back at the navigation form. Okay, just a few adjustments that I think you should do to all navigation forms. I'm going to right click the navigation and go to design view. I'm actually going to go to the property sheet. I'm going to click in the gray area of the form there. The first thing I'm going to do is go to the format tab and the caption.
The caption should not be nav, it should be main navigation. I will not have any records or navigation capabilities because this is a form that allows me to jump from place to place. For record selectors, I'll choose no. Navigation buttons, I'll choose no. I'm double clicking and it's changing from yes to no. Let's go ahead and save that. The form itself is called nav, but when I change my view, I'll see my caption, main navigation.
Okay, let's go do the same step to our reports. I'll go run reports, I'll change my view, I'll go to my design view. My caption here will be report navigation, because I do not have records I don't need record selectors, because I don't have records I do not need navigation. Perfect, I can save it. Let's go take a look, and then let's return to nav. You may start to see that your solution is taking shape.
As you build out each user interface, this shows you the different aspects of your new system.
- Name three reasons for businesses to utilize Excel.
- Recall the uses of the screenshot option.
- Identify the steps necessary to create a table in Access.
- List three items you can add to a query.
- Determine how to maintain linked tables.
- Recognize the report object that includes step-by-step instructions and totals.
- Apply the appropriate action to run a query in macro.