Solved

Database design

Posted on 2014-09-22
5
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

734 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