By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,401 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,401 IT Pros & Developers. It's quick & easy.

Populating a second field based on what was entered in the first field

P: n/a
Hi,

I have a question regarding using drop down lists and how to get them to
limit the list of a subsequent field. I have a database which has the names
of colleges. Each college has it's own set of specific courses. All the
colleges are in my Institutions table, and all the course codes are in my
Course Codes table and are related based on InstitutionID.

On my form, when a user inputs the InstitutionID of a particular college, I
want the course codes field to be limited to just the courses that
correspond to the courseID. For example, let's say the first field asks for
the InstitutionID and the second field asks for the CourseCode. If the user
enters CollegeA in the InstitutionID field, in the coursecode field a list
of only the course codes for CollegeA should be available via a drop down
list. I believe this can be accomplished with an afterupdate event on the
InstitutionID field however I am not sure how to go about this.

Any help is much appreciated.

Mike
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Big Time" <bi************@remove-for-spam-hotmail.com> wrote in message
news:cd***********@lettuce.bcit.ca...
Hi,

I have a question regarding using drop down lists and how to get them to
limit the list of a subsequent field. I have a database which has the names of colleges. Each college has it's own set of specific courses. All the
colleges are in my Institutions table, and all the course codes are in my
Course Codes table and are related based on InstitutionID.

On my form, when a user inputs the InstitutionID of a particular college, I want the course codes field to be limited to just the courses that
correspond to the courseID. For example, let's say the first field asks for the InstitutionID and the second field asks for the CourseCode. If the user enters CollegeA in the InstitutionID field, in the coursecode field a list
of only the course codes for CollegeA should be available via a drop down
list. I believe this can be accomplished with an afterupdate event on the
InstitutionID field however I am not sure how to go about this.

Any help is much appreciated


The RowSource for the Course ComboBox needs to be a query that uses a
reference to the Institution ComboBox as a criteria.

SELECT Course From Courses WHERE Institution = Forms!FormName!Institution

Then in the AfterUpdate event of the Institution ComboBox you have code to
Requery the Course ComboBox.

Me.Course.Requery.
Nov 13 '05 #2

P: n/a
Thanks. Worked like a charm!

The RowSource for the Course ComboBox needs to be a query that uses a
reference to the Institution ComboBox as a criteria.

SELECT Course From Courses WHERE Institution = Forms!FormName!Institution

Then in the AfterUpdate event of the Institution ComboBox you have code to
Requery the Course ComboBox.

Me.Course.Requery.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.