Solved

Database design

Posted on 2014-09-22
5
151 Views
Last Modified: 2014-09-22
I am designing a database that will be used to collect information about usage of our center by students.  I will be using SQL express as the back end and ACCESS as the front end of this database.  I want to be able to have one of our coaches select the prefix for a class (e.g. MGMT or BGEN) and have a second drop down have all the course numbers that are available for that prefix (e.g. BGEN would show 194, 205, 312, and MGMT would show 255, 349, 447 etc.)  What would be the best way to go about this?  I could just have all the classes and numbers as one value that would be looked up, but that will become very cumbersome when you have well over 300 choices....

I am using SQL express 2014 and Access 2013.
0
Comment
Question by:mjburgard
  • 3
5 Comments
 
LVL 12

Accepted Solution

by:
pdebaets earned 500 total points
ID: 40337515
What you may want is cascading combo boxes. Please see this excellent article: http://www.experts-exchange.com/Database/MS_Access/A_5949-Cascading-Combos.html
0
 
LVL 1

Author Comment

by:mjburgard
ID: 40337530
After a quick scan, this appears to be exactly what I am looking for.  Grazie!
0
 
LVL 1

Author Comment

by:mjburgard
ID: 40337574
I've requested that this question be closed as follows:

Accepted answer: 0 points for mjburgard's comment #a40337530

for the following reason:

Exactly what I am looking for.
0
 
LVL 1

Author Closing Comment

by:mjburgard
ID: 40337575
Exactly what I am looking for
0
 
LVL 3

Expert Comment

by:Jerry_Justice
ID: 40337581
You will need a table of all courses:

Table: tblCourse
Fields:
CoursePrefix,text,4
CourseNumber,Text,4
CourseDescription,Text,100

any other fields you think are appropriate like maybe an ActiveYN boolean field, etc..
But, for the example you are asking for, those three fields are good enough

So, the first combo box will have the rowsource set to:

SELECT Distinct "Course"."CoursePrefix" FROM "Course" ORDER BY "CoursePrefix"

The second combo will be populated in the first combo's AfterUpdate event:

Private Sub ComboPrefix_AfterUpdate()
    ComboCourseNum.RowSource = "Select CourseNumber from Course Where CoursePrefix='" & Me.ComboPrefix & "' order by CourseNumber"
    ComboCourseNum.Requery
    Me.ComboCourseNum= Me.ComboCourseNum.ItemData(0)
End Sub

So, every time someone picks a choice from the first combo, the AfterUpdate event will re-populate the second combo with a list of course numbers for only the course prefix selected.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now