473,947 Members | 6,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1571
"Big Time" <bi************ @remove-for-spam-hotmail.com> wrote in message
news:cd******** ***@lettuce.bci t.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.Reque ry.
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.Reque ry.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2370
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 want "Doug" to populate the FIRST Name field and "Ford" to populate the Last Name field. At present I have to manually enter them. I have a table called Name ID in which I have stored the swimmers ID numbers , first and last names in the...
13
2898
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 from a table and I want to take that selection and use it to populate the next dropdown. So far: 1) I tried using a query that said select specificissue from specific_issue and used as my criterion !!
6
2891
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 a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
2
3353
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 Usercontrols. Problem: When I am populating dynamic user control (ascx) page in Page_load event it works fine for the first list item from combobox. When I change the item in combobox, usercontrols are build properly but value will be same in second...
9
3147
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 be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
13
3561
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 first 7 have to do with respondent information like grade, class and age. I have those in a table with a PK of RespondentId, which is autonumbered. Questions 8-40 all have the same format. For these questions I have a table set up with the...
15
26735
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 listbox based on the selection of table name in the first listbox I am new to VBA, and am trying to do that in the following manner: Private Sub List0_BeforeUpdate(Cancel As Integer) Dim strTable As String strTable = List0.Value ...
5
2019
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 contains appointment data. The second subform contains delivery data. The three tables are linked by member record number. I have two problems that I have been trying to figure out for weeks! The first is that I want the two subforms to populate...
5
2080
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 field that activates a database query and get the result - I control the length of the entered text with Java Script in the input field and activate the query without clicking the search button when a certain length is achieved - second submit...
0
10163
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11576
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11160
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10692
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9888
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6116
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4538
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3543
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.