473,387 Members | 2,436 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,387 software developers and data experts.

Cascading Combo not showing results

I am new to Access and have been charged with creating a database for our course alumni.

I currently have a "Contacts" form and am trying to create a subform to hold the course alumni information. I would like the first combo box to contain the course and the second to show the approriate years. Everything seems to be working except the years are not showing in the second combo box.

My tables are set up as:

CourseNames
CourseID (primary key)
CourseName (text)

Years
YearID (primary key)
Years (text)

CourseYears
CourseYearID (primary key)
CourseID (numbers)
YearID (numbers)

In the CourseYears table I have entered in the CourseID and YearID for the appropriate combinations. I am trying to create cascading combo boxes so that when the course is chosen, the appropriate years will appear.

I have two combo boxes: CourseName and CourseYear

The code for my CourseName after update is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CourseName_AfterUpdate()
  2. Dim strSQL As String
  3.  
  4. strSQL = "SELECT CourseNames.CourseID, Years.YearID, Years.Years FROM CourseYears INNER JOIN " & _
  5.          "(CourseNames INNER JOIN CourseYears ON CourseNames.CourseID = CourseYears.CourseID) " & _
  6.          "ON Years.YearID = CourseYears.YearID WHERE CourseNames.CourseID= " & Me![CourseName].Column(0)
  7. Me![CourseYear].RowSource = strSQL
  8. Me![CourseYear].SetFocus
  9. Me![CourseYear].Dropdown
  10. End Sub
This is not showing the years in the second combo box.

Any help you could give me is much appreciated!
Jun 24 '09 #1
1 1660
NeoPa
32,556 Expert Mod 16PB
Hi. Check out Example Filtering on a Form and let us know if you manage to resolve it from this.

Welcome to Bytes!
Jun 24 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
6
by: visionstate | last post by:
Hi there, I am building a database that requires cascading lists on a form. I currently have (I may be adding more later) 3 combo boxes on my form - Department, Surname and Forename. The user...
0
by: visionstate | last post by:
Hi All, I have a few tiny problems left with my cascading combo boxes. Here is what my form looks like: http://img219.imageshack.us/my.php?image=databaseformwl5.png The way it works is by...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
4
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields...
1
by: didihynes | last post by:
Hi Guys, I'm in desparate need of help. I am producing a database for my dissertation and have got majorly stuck. I am currently creating a form in which the user will select a student from a...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
7
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.