In this lesson, I will show you how to use a combo box in a useful way.
In the previous lesson, I told you how to add the “Previous” and “next” buttons to your form, so as to navigate between records.
When your table or query has only a dozen records, it is not too bad to find a student. But when there are hundreds of students in your table, it can take a while finding the right student and pursuing the search results. We have an answer to that with the “Combo box” control.
The first thing I do is create a “Query” that shows our students sorted alphabetically. This makes it easier to see an alphabetical order of all students in the list box later.
Then we make a “Relationship” between the newly created “Students Alphabetically Query” query and the “Results” table.
Select the “Database Tools” tab and click the “Relationships” button in the “Ribbon”.
Right-click in the window and select “table” (1) in the pop-up menu.
This opens the “Show Table” (2) dialog.
Choose the “Queries” (3) tab.
Select the newly created query and click the “Add” button.
This places the query in the “Relationship” window (4).
Create a “Relationship” between the “studentID” in the query and the “studentID” field in the “Results” table (5).
Close the “Relationship” window.
Then we make a new form using the “Form Wizard”.
Select the “Create” tab in the “Ribbon” and click the “Form Wizard” button.
In the first wizard window, select the “Students Alphabetically Query” (1) query and move all fields from this query into the “selected fields” (2).
Then select the “Results” (3) table, our sub-table, move the fields “subjectID”, “score” and “grade” in the “Selected Fields” (4) and click the “Next” button.
In the next window, click the “Next” button again.
In the next wizard window, choose a layout and click the “Next” button.
In the last window of the wizard, specify a name for the form, and a name for the subform.
Click the “Finish” button.
We will continue in the next lesson.
You've completed Lesson 47 START NEXT LESSON