Solved

Database design

Posted on 2014-09-22
5
145 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
Comment Utility
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
Comment Utility
After a quick scan, this appears to be exactly what I am looking for.  Grazie!
0
 
LVL 1

Author Comment

by:mjburgard
Comment Utility
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
Comment Utility
Exactly what I am looking for
0
 
LVL 3

Expert Comment

by:Jerry_Justice
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

762 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

13 Experts available now in Live!

Get 1:1 Help Now