How to choose a value for a field from a related table?

I created three tables in a LibreOffice Base database. One table named Students contains two fields: StudentID and StudentName, the second table called Courses contains two fields: CourseID and CourseName, and the third table named StudentCoursePairings contains three fields: PairingID, CourseID, and StudentID.

I created a relationship between the three classes in the natural way indicated by the fields’ names.

I have entered a view records into the Students table, and I have entered a few records into the Courses table.

Now I’d like to add a record to the StudentCoursePairings table. It appears I have to enter a value into the StudentID/CourseID fields manually. However, I’d like to be able to choose the value from a dropdown list - or some similar gadget - of the values available in the Students table, resp. the Courses table.

How can this be accomplished?

  1. Create a main form with students or courses with a subform linked to the mapping table through the common ID.
  2. The subform needs to have a table grid with a listbox.
  3. The listbox in the table grid should be analog to SELECT "Name", "ID" FROM "other_list" ORDER BY "Name"

Now you see the courses of the student selected in the main form or students of the selected course respectively. The subform items represent the ID values of the respective other list masked by the human readable names.