An embedded view allows you to filter a data set from a view by a single relationship. It is an embedded one-to-many relationship inside your form. You can use this between multiple tables or on a single table, provided you set the relationship correctly between your table and your embedded view.
For example, let's say you have a Projects database which stores your projects and associated tasks. You want to be able to view all tasks auto-filtered by project, and also be able to see all tasks related to a project while viewing a specific task. To set this up, we need a Projects table which stores all of your Projects and info about the project. Your Projects table might look like this:
Field Name | Field Type |
GeneratedID | AutoNumber |
ProjectName | ShortText |
StartDate | Date |
CompleteDate | Date |
AssignedTo | ShortText |
Description | Memo |
You also have a Tasks table which stores info about all of your tasks, which may look like this:
Field Name | Field Type |
GeneratedID | AutoNumber |
TaskName | ShortText |
ProjectName | ShortText |
StartDate | Date |
CompleteDate | Date |
AssignedTo | ShortText |
Description | Memo |
When you create a task, you can use a dropdown menu to lookup the ProjectName from the Projects table and store it in the ProjectName field on the Tasks table. This then creates a relationship between the Projects table and the Tasks table using the ProjectName (you could also use generatedID or any other field, as long as it is unique to the project).
We can use that relationship in our Projects Form and Embedded View. First, we need a view of our Tasks from the Tasks table. Lets call it All Tasks. This view should include the related field (ProjectName). It may look something like this:
FieldName | Alias | Sort Order | Sort Dir |
Tasks.GeneratedID | Task ID | ||
Tasks.ProjectName | Project Name | 1 | ASC |
Tasks.TaskName | Task Name | 3 | ASC |
Tasks.StartDate | Start Date | 2 | DESC |
Tasks.AssignedTo | Assigned To |
We would then put the embedded view on the Tasks form. In the relationship section, the left dropdown is the table connected to the form, so in this case, the Projects table fields. The right dropdown is connected to the view that you choose, so this will contain the fields from our All Tasks view. The relationship would look like this:
Now we have the relationship set. This relationship will auto-filter the embedded view based on the record you are viewing in your form. So if you have a project called Client ABC Project, then you view that Project record in your Projects form, the embedded view will only show the tasks for that project.
You can do the same thing on your tasks form, so you can see other tasks related to the one you are working on. You would follow the same process, the only difference is that your left dropdown in the embedded view setup would now be the Tasks table fields.