Complex Query to determine status code

psycoperl

Active Member
Joined
Oct 23, 2007
Messages
339
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
  3. Web
I am working on a project that will track what test(s) a student needs and assign them the status appropriate code.

I currently have 2 tables & 3 queries in my database
(tblStudent, tblATBCode, qryMaxMath, qryMaxReading, qryMaxWriting)

For Each Student in tblStudent (by tblStudent.StudentID) i need to determine the correct tblATBCode.ATBTestCode based on the students records where the Met value is either "Y" or "N"
tblATBCode.MetMA = qryMaxMath.MaMet
tblATBCode.MetRA = qryMaxReading.ReadingMet
tblATBCode.MetWO = qryMaxWriting.WoMet
(If there is no test record in a querys treat as if it was a "N")

I can't figure out where to start on this code. I am thinking that a query could do this but not sure. Any help you can provide will be great.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Part of the reason for the struggle could be the structure.
You need a third table to join tblStudent and tblATBCode, because the relationship is many to many (each student will sit many subjects, each subject covers many students).
This join table doesn't need many fields but it will, as a minimum, require
ATBStudentID (Primary key, Autonumber)
StudentID (Number, if you used AutoNumber for StudentID in the Student table)
ATB_ID (Ditto)

Join tblStudents to this table on StudentID, and join tblATBCodes on the ATB_ID.

Entering data into a setup like this is best done using subforms.
Student form will have a subform based on the join table, with StudentID as the master and child fields.
As you browse to each student you will see their ATB codes. Add a new ATB in the subform and it will be assigned to that student.

Denis
 
Upvote 0
Thank you for the inspiration... I think I got the solution. :-)
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,508
Members
452,918
Latest member
Davion615

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top