Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter selections based on a previous field 2

Status
Not open for further replies.

Dumboy

Technical User
Joined
Feb 29, 2000
Messages
97
Location
US
I have a look up table that contains two columns: Subject and Teacher, Using a form I would like to select the Subject and automatically limit the next field (Teacher) to those associated with the selected subject on the Look Up table.
For eg:
Travis Biology
Benoir Bilology
James Geography

so when I select Biology as my subject the next field gives me only the options Travis and Benoir.

Any ideas?

Thanks!


Dumboy.! Ouch.! .my brain.....
spiderdesign@yahoo.com

It's hard to think with only one neuron......Ouch.....!....it hurts when I think......!
 
Assuming:
cboSubject is your subject combo box
cboTeacher is your teacher combo box
Table1 is your lookup table name
Formname is your form name

On your Teacher combo box, change the record source property to

SELECT [Table1].[TeacherName],...
FROM [Table1]
WHERE [Table1].[Subject] = [Forms]![Formname]![cboSubject].value

Then, on the After Update property of your subject combo box add this code:

me.cboTeacher.requery


This will cause the recordsource of the teacher combo box to be refreshed each time you select a new subject.


Hope this helps... J. Jones
jjones@cybrtyme.com
 
JJonesal:

Great it worked like a charm... thanks... the only thing I had to change was me.cobTeacher.requery gave me an Macro missing error, so I created a requery macro and put the name of the macro on the After update property box on the cobSubject box.

Thanks again.......... :-)

Dumboy.! Ouch.! .my brain.....
spiderdesign@yahoo.com

It's hard to think with only one neuron......Ouch.....!....it hurts when I think......!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top