Query Criteria Quandry

funderburgh

Registered User.
Local time
Today, 00:43
Joined
Jun 25, 2008
Messages
118
How can I get a query criteria selected from a table value unrelated to the query? In this case my query is of a table of school classes that details the Teacher, Classroom, period, etc. I also have tables that specify teacher's names and class names so they are all entered uniformly. I want to put combo boxes on a form tied to these lookup tables whose vaules become the criteria, but I'm stuck. Any help is appreciated.
 
Hi,

You can use unbound control boxes on your form to populate you teachers and classes lists, setting the rowsource with something like:

SELECT tblTeachers.TeacherID, tblTeachers.Teacher FROM tblTeachers ORDER BY tblTeachers.Teacher;

then set the column count property to 2, and the width property to 0cm, 2.5cm.

Eventually in your query under the teacher field set your criteria to the reference of your unbound combo used i.e. Forms!FormName!ControlName

Obviously you have to replace the above table/field names with your actual names.
 
Thank you very much, that is working well. Now my quandry is the output of the dynaset. I am getting it in datasheet view, which is OK, but I want to have the results populate a subform of the form where I have the combo boxed query parameters. I can drag the query into my form and it creates a subform in the manner I imagine, but the data still pops up in the datasgeet. Any assistance is warmly apppreciated.

John
 
Hi,

create a form based and your query. Then on your main form from the toolbox use the subform icon, to create a subform and from the wizard select your new created form, so that it will be a subform on your main form.
 
Thank you so much for your very on-point help. I have two manuals, but frankly getting right to the answer of some of these fundemential questions is not very straight forward. My form looks and works great and I am in your debt.
 
you're welcome, i am glad that you managed to solve your issues :)
 

Users who are viewing this thread

Back
Top Bottom