2.3 Modifying Application Views
The next steps involve creating a
mechanism for end users to interact with the new relationship between
Projects and Locations. Both the List view and the Datasheet view must
be edited. The following steps detail the process required to edit the
automatically generated List and Datasheet views:
1. In the Tile Pane click the Projects tab; then select the Datasheet view from the list of available views.
2. Click the Edit button over the main content area to enter the view editor.
3. Click the
Add Existing Fields button in the Tools section of the Ribbon’s View
Design tab to display the Field List pane in Access.
4. Drag the Location field from the Field List pane onto the right end of the Datasheet’s list of fields, as shown in Figure 5.
5. Click the Save button to send the view changes to the server.
6. Close the
Projects Datasheet tab, and open the List view for editing by clicking
the view name and then clicking the Edit button over the main content
area.
7. Click the
Tasks related items field, and press Delete on the keyboard. With the
Tasks table having been deleted, the interface on the List view is
unnecessary.
8. The Project
Locations related field should have been automatically added to the
view, but if it hasn’t been added, simply double-click the Related
Items control to add one to the page.
2.4 Creating a Query
Referring to Figure 2
in the “Adding, Removing, and Editing Tables” section, Employees are
related to Locations through the Projects and Project Locations tables.
Users of the consultant tracking application may want to understand
which consultants work in which locations. Building a query to link
these data elements more closely together allows the app to use the
query as a data source in later tasks. Follow these steps to create a
new query, which will be stored in SQL Server as a table-value function:
1. On the Home tab on the Ribbon, click the Advanced drop down in the Create section, and select Query.
2. In the Show Table pop-up, select the Employees, Projects, Project Location, and Locations tables, and click OK.
3. In the
Builder grid, set the first field to Neighborhood from the Locations
table and the second field to Display Name First Last from the
Employees table, as shown in Figure 6.
4. Save the query as Employee Locations.