Combobox - Retrieving only the required records

Joined
Aug 14, 2005
Messages
3
Reaction score
0
I have 2 forms - 'Existing Instructor' and 'Existing Course' which are linked. The first form has the following fields - InstructorID, Instructor First Name, Instructor Lase Name and Department, all of which get populated when the form loads - the information for all the fields is retrieved from an 'Instructor' table. The 'Existing Course' form has 4 fields - InstructorID, CourseNumber(a Combobox), Course Name and Course Description. If a user on the 'Existing Instructor' form clicks a button 'View Existing Courses'(named Command11), it opens the 'Existing Course' form, displaying the corresponding InstructorID but the other
fields should remain blank. When the user enters clicks on the CourseNumber combobox to view the drop down list, only CourseNumber related to that specific InstructorID should be retrieved from a 'Course' table. When a CourseID is selected, the corresponding Course Name and Course Description should populate the remaining text fields. The 'Instructor' table has a one-to-many relationship with the 'Course' table (InstructorID is the primary key in the first table and the foreign key in the second).

Here's my problem:
1)My combobox pulls up all the CourseNumber records in the Course table but i want it to retrieve ONLY the ones corresponding to that InstructorID
2)When I select a value from the combobox, how do i get the remaining 2 fields Course Name and Course Description to get populated accordingly?

Any help would be appreciated. Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top