WEBVTT

1
00:00:00.530 --> 00:00:07.530
Hello. Welcome to KnowledgeCity's course on Microsoft Access 2021 Intermediate.

2
00:00:07.530 --> 00:00:13.530
My name is John Veron, and in these lessons you will learn about advanced forms.

3
00:00:13.530 --> 00:00:18.530
In this lesson, I will show you how to open reports from forms.

4
00:00:18.530 --> 00:00:26.530
In some Microsoft Access databases, forms are only used as an easy and user friendly way to add and edit data.

5
00:00:26.530 --> 00:00:33.530
While in others, forms are more like a complete user interface as part of a full-fledged database application.

6
00:00:33.530 --> 00:00:40.530
In the latter case, it can often be desirable to have hyperlinks between different objects in the database.

7
00:00:40.530 --> 00:00:48.530
This allows users to open forms, reports, and queries without necessarily having to know terms like form, report, and query.

8
00:00:48.530 --> 00:00:56.530
They can just click the hyperlink and see what they want without having to worry about what type of database object it is or where to find it.

9
00:00:56.530 --> 00:01:01.530
Let's create a form which contains a hyperlink to a report to show how this works.

10
00:01:01.530 --> 00:01:05.530
For this example, we will use a Northwind example database.

11
00:01:05.530 --> 00:01:14.530
First, we need a form. We can either create one from scratch, or we can use one of the forms that comes with the sample database.

12
00:01:14.530 --> 00:01:21.530
I will show you both ways. If you want to create your own form, go to the Create menu and click on the form wizard.

13
00:01:21.530 --> 00:01:26.530
Choose the table customers and add as many fields as you want to display.

14
00:01:26.530 --> 00:01:33.900
You can keep all the other options default if you want, or you can change them.

15
00:01:33.900 --> 00:01:42.900
I am just going to rename this form to Custom Form and open it straight in the Design View.

16
00:01:43.900 --> 00:01:46.900
Let's go ahead and save it.

17
00:01:46.900 --> 00:01:53.900
Instead of creating your own form, if you prefer to use one of the example forms, a good choice is the one called Customer Details.

18
00:01:53.900 --> 00:02:01.720
This is the one I am going to demonstrate on because it is already formatted to look nice.

19
00:02:01.720 --> 00:02:07.720
Let's open this form in Design View. Then in the Controls menu, click on hyperlink.

20
00:02:07.720 --> 00:02:15.810
This will open the Insert hyperlink window.

21
00:02:16.810 --> 00:02:27.860
Choose Objects and Database. Then find the report called Customer Address Book. Choose that one and click OK.

22
00:02:27.860 --> 00:02:31.860
Access will now create the hyperlink and place it on your form.

23
00:02:31.860 --> 00:02:37.860
Unfortunately, it is not always consistent about where it places the hyperlink, so you may have to look around for it.

24
00:02:37.860 --> 00:02:41.860
And once you find it, you will probably have to move it to a position you like.

25
00:02:41.860 --> 00:03:09.480
Once you have that, go ahead and save this form and then switch it to Form View so you can view the result. There's our hyperlink.

26
00:03:09.480 --> 00:03:14.480
Now if we click it, we should see the report Customer Address Book.

27
00:03:14.480 --> 00:03:22.480
Notice that it does open but it opens behind the form. That's because Microsoft Access always gives the form that you are on priority.

28
00:03:22.480 --> 00:03:29.480
There is one limitation with this approach, however. It will only work for reports that don't require a filter.

29
00:03:29.480 --> 00:03:38.430
For example, it would not work for a report that brought up information specific to the customer would currently have selected on the form.

30
00:03:38.430 --> 00:03:45.430
While there are ways to do that, it would require custom macrocode written in VBA.

31
00:03:45.430 --> 00:03:52.430
Hyperlinks like this can also be placed on reports and they can open other forms, reports or queries.

32
00:03:52.430 --> 00:03:59.430
They can go a long way to making a database application more intuitive and easier to use.

33
00:03:59.430 --> 00:04:06.430
Thanks for watching. Stay tuned for the next lesson where I will show you about using calculated values in forms.

