Replace values of a column with another column by criterias in another table (1 Viewer)

saqassemi

Registered User.
Local time
Today, 01:31
Joined
Nov 11, 2017
Messages
37
Hello every one. I am developing a database for our schools and I have to change arrangement of subjects every year because of some reason from ministry of education.
So I have a table to enter scores and a table to arrange subjects titles for every year and grades.
There is a query that rearrange values but i dont know how to reference Year and Grade criterias to tblSubjects.
The file is attached. Is there any solution without dlookup for scores in form beacuse i want to enter or change scores.
 

Attachments

  • reArrange fields Values.accdb
    500 KB · Views: 82

Ranman256

Well-known member
Local time
Today, 04:31
Joined
Apr 9, 2015
Messages
4,337
I have a School Yr table. each year a new curriculum is built with the classes for that year.

school yr.jpg
 

saqassemi

Registered User.
Local time
Today, 01:31
Joined
Nov 11, 2017
Messages
37
Mr Ranman256, Thanks for your reply. Could you attach a sample access file.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:31
Joined
Feb 19, 2002
Messages
43,266
Your problem is that the tables are not normalized. Ranman's solution is also not normalized so it wouldn't help either. Both look more like spreadsheets than relational database solutions. When you are building forms, use combos to select the FK values to avoid typos.

You need more tables.
tblSubjects
SubjectID (autonumber pk)
SubjectName

tblSchoolYear
SchoolYearID (autonumber pk)
SchoolYear
Grade

tblClasses
ClassID (autonumber pk)
SchoolYearID (FK to tblSchoolYear)
SubjectID (FK to tblSubjects)

tblStudents
StudentID (autonumber pk)
FirstName
LastName

ClassScores
ScoreID (autonumber pk)
ClassID (FK to tblClasses)
StudentID (FK to tblStudents)
TestDate
Score

This is a start. It will give you as many grades and classes as you need. It also provides for more than one score for each class. You can average them to get a total for the class for the year.
 

saqassemi

Registered User.
Local time
Today, 01:31
Joined
Nov 11, 2017
Messages
37
Thanks all. I know a query can replace values of fields. For example there are 3 fields. I replace data of column 1 with data of column 2 ...
I want a query to look at tblSubjects for replacing. There is a picture attached to say what i want simpler. Thanks for your times.
 

Attachments

  • replace columns values.jpg
    replace columns values.jpg
    71.9 KB · Views: 85
Last edited:

saqassemi

Registered User.
Local time
Today, 01:31
Joined
Nov 11, 2017
Messages
37
Your problem is that the tables are not normalized. Ranman's solution is also not normalized so it wouldn't help either. Both look more like spreadsheets than relational database solutions. When you are building forms, use combos to select the FK values to avoid typos.

You need more tables.
tblSubjects
SubjectID (autonumber pk)
SubjectName

tblSchoolYear
SchoolYearID (autonumber pk)
SchoolYear
Grade

tblClasses
ClassID (autonumber pk)
SchoolYearID (FK to tblSchoolYear)
SubjectID (FK to tblSubjects)

tblStudents
StudentID (autonumber pk)
FirstName
LastName

ClassScores
ScoreID (autonumber pk)
ClassID (FK to tblClasses)
StudentID (FK to tblStudents)
TestDate
Score

This is a start. It will give you as many grades and classes as you need. It also provides for more than one score for each class. You can average them to get a total for the class for the year.

Could you upload it as an access file.
 

Users who are viewing this thread

Top Bottom