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
Solved

Database design

Posted on 2014-09-22
5
155 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

829 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