Forums

This topic is locked

Related recordsets -- please help.

Posted 25 Mar 2004 10:28:31
1
has voted
25 Mar 2004 10:28:31 Kevin Garry posted:
I'm trying to do what I think is a basic datbase-driven feature.

Simply put, I have 2 pages:
1. List of students and details of each student in table.
2. Form for updating which students should be on the list.

Each Teach can create their own list of students. So I have 2 db tables (SQL) that I'm referencing ...
1. Teach list (each list has 5 columns that can contain a student ID)
2. Student details (key in table is same student ID)

On the Update form, I allow the user to select up to 5 students from a Menu. The menu displays the students name for selection, but saves the student ID to a field in the Teacher List table. When the values are selected and the form is submitted, the user is returned to the List form, showing a summary of the lists of students submitted by each teacher.

This much I have working properly, sort of. Each list shows the ID of each student.

What I want to do, is to pull data from the Student details table, based on the ID in the related Teacher List table...
I want to end up with a table that looks like this:
ID____FIRSTNAME_______LASTNAME______GPA
11 ...
22 ...
31 ...
45 ...
53 ...

I can get it to work , in a repeating list, so that the table above is repeated for each teacher list. I am unable to populate the related fields (NAME, GPA, etc.) into the table. I need these values to come from the Student Details table, using the ID from the Teacher List table as the key.

Do I need to relate the tables together in MSSQL? If so, can you describe how the relationship should be defined?
Do I need to do an advanced query? Do I need special variables?

Keep in mind that this needs to function in a repeating list.

I'm sure there is a relatively simple way to accomplish this, as it seems to be an obvious use of a relational database, but I can't figure it out. Again, I'm new to SQL, so please be detailed if you have a chance to respond.

If you need more info to understand my questions, please let me know.
Thanks in advance,

Kevin.


Replies

Replied 25 Mar 2004 18:28:40
25 Mar 2004 18:28:40   replied:
Your help section indreamweaver will help. Look for join tables that will set you in the right place.

Reply to this topic