473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

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

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
2 1549
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Geoff Portbury | last post by:
I'm a swimming club coach. I have a data base for recording times at various meets. I have a FORM for entering times called SWIM TIMES. When I enter the swimmers name ID, eg FOR01 for Doug Ford I...
13
by: melih.onvural | last post by:
Group, I'm having a tough time understanding some of the previous posts on this topic so I wanted to write what I've tried and hope that you can help me troubleshoot. I have a dropdown populated...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
15
by: NasirMunir | last post by:
I am trying to populate a listbox from another listbox on a access form. My first listbox has names of tables on a linked odbc databse. I am trying to display the tuples of the table in the second...
5
by: lindabaldwin | last post by:
Hi, I am having a really difficult time with this, so any help is very much appreciated. I have created a form with two subforms. The parent form includes patient data. The first subform...
5
by: huseyin | last post by:
Hello, I have two forms written mainly in php. Here how it functions currently: - First form has two submit buttons. - First submit button is a search button that submits a value of an input...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.