The query Append to Scores - Pick A/T in the LanguageArtsClasses database creates a partial record in the Scores table for each student for the Assignment/Test ID number that you enter. (There must already be a matching record in the Assignment/Test table.)
Problem: Each assignment or test needed a record in Scores for each of the 92 students. Boring to create all 92 manually!
Solution: Use a query to create partial records automatically. The teacher (me!) enters an ID number for the assignment or test. Running the query adds a record to Scores for each student for the selected assignment or test. There are no scores yet. After running this append query, I could then open the Scores table and finish the newly appended records by typing in a score for each student.
Create a Select query by selecting the source tables/queries and the fields that you want to append to the destination table.
Apply any sorting and criteria (This one includes a parameter.)
Change the select query to an Append query. A dialog asks for the
name of the table to which you will append records. A new row, Append To,
appears in the Design grid.
Match fields: Each column that shows in the query results must have a matching field
in the destination table. You might use some fields to sort or select
records that do not themselves show in the results.
Make sure that the field in the Append To row is the one that matches the field at the top of that column. Access is pretty smart but sometimes it guesses wrong about this if the field names are not exactly the same.
the datasheet to check what will be appended.
Yes, there is a record for each of the 92 students for assignment ID 88.
Run the query by clicking the Run button.
Tells how many rows will be appended. Very helpful to know in many situations.
results: The table with the newly appended records does not open
automatically. You must open the destination table yourself to view the
About the blank fields: The LetterGrade values are added later with an Update query, which we will look at shortly. The Ignore? field is a Yes/No field that would normally be blank. A Yes in this field would mean that the score would not be included in averages.
Point of Confusion/Disadvantage: Unnecessary records are created by this append query if the assignment or test was not actually assigned to all classes! A/T ID 87 is an example of this. Assignment 87 was a spelling test that was not assigned to class D for scheduling reasons. The C/S value of 8 is the code for class D and Spelling. So, the records for assignment 87 and C/S value of 8 have no scores.
The unwanted records could be deleted manually or by using a Delete query.
AutoNumbers: The AutoNumber primary key will not reuse the ID numbers of deleted records. That is why the ID numbers for the new records are over 9000 when there are only 7537 records in the table. Quite a number of records were deleted along the way.
If there were going to be a lot of assignments that would not be given to all
three classes, the query could be changed to include a parameter for the C/S field,
which picks out the class and subject of the assignment. Wonder why I
didn't do that??
Lessons Databases Appendix
Teachers: Request permission to use this site with your class
Copyright © 1997-2012 Jan Smith <email@example.com>
All Rights Reserved
~~ 1 Cor. 10:31 ...whatever you do, do it all for the glory of God. ~~
Last updated: 30 Apr 2012