Reference a query from a combobox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am running a query to find all students for a given teacher. I am trying
to reference the teacher by using a dropdown list in a form. Then, I'm
trying to view the results of the query in another dropbox on the form. My
criteria for the query is:

WHERE (((tbl_Teacher.Teacher_name)=[formname].[combobox]))

I'm not sure where the disconnect is. The second combobox, that uses the
query for a source never gets a value. I can run the query by itself and a
box opens and asks for a value for a value for [formname].[combobox]. I can
enter a teachers name, and the query then runs perfectly.

Any ideas???
 
My own experiance of this type of thing is that you need
to refresh the second list box after you have selected a
value in the first. Set an event in the AfterUpdate
property of the first list that says
me.SecondList.Requery - (where SecondList is the name
of your second list control)
 
Now I'm getting an error that says Microsoft can't find the macro "me"
Thanks for helping!

ACG said:
My own experiance of this type of thing is that you need
to refresh the second list box after you have selected a
value in the first. Set an event in the AfterUpdate
property of the first list that says
me.SecondList.Requery - (where SecondList is the name
of your second list control)

-----Original Message-----
I am running a query to find all students for a given teacher. I am trying
to reference the teacher by using a dropdown list in a form. Then, I'm
trying to view the results of the query in another dropbox on the form. My
criteria for the query is:

WHERE (((tbl_Teacher.Teacher_name)=[formname]. [combobox]))

I'm not sure where the disconnect is. The second combobox, that uses the
query for a source never gets a value. I can run the query by itself and a
box opens and asks for a value for a value for [formname].[combobox]. I can
enter a teachers name, and the query then runs perfectly.

Any ideas???
.
 
Back
Top