Hello Scott, sorry for the late reply, I'm a teacher so was off for Easter with no Access at home.
I'm trying to make a small database to record extra lessons teachers give to SEN students.
So far I have the following tables:
Teachers (ID and Name)
Students (ID, name, year, form)
Subjects (ID, Name)
Rooms (ID, Name)
Times (ID, period) (schools here break the day into periods of 40 minutes)
Resource (ID, TeacherID, Student ID, RoomID, subjectID)
The Resource table can be populated by selecting from listboxes that reference the different tables, so I can select a teacher, and allocate them students, a room, a subject and a time. This bit seems to work ok.
I then want to query which students a teacher is taking and for this have a form 'querytable' with 2 listboxes. One (List1) shows the teacher's names and it gets these from the 'Teachers' table. When I select a teacher's name from List1, I want the second listbox, List14, to show all the students that teacher takes, information that is available from the 'Resource' table.
Apologies for the ropey naming of things, e.g. Teachers.Name and Resource.TeacherID both show the teacher's name. (I'm learning as I go along).
I thought this should work, i.e bring up a list of all the students assigned to a particular teacher, when that teacher is selected in List1.
The sample I put up earlier was just to see if I could get the 2nd listbox to display the same thing that was selected in the first listbox
SELECT Resource.StudentID FROM Resource WHERE Resource.TeacherID = [Forms]![querytables]![List1];
when run, it produces a box requesting a parameter be entered. Entering anything has no effect and making a new selection makes the request for a parameter come up again. The part after the = sign doesn't seem to be reading what is in List1 from what I can see. Are there any obvious mistakes?