schoolresults

  • Thread starter Steven Verschelde
  • Start date
S

Steven Verschelde

Hello,

i have a table with the following data

studentnumber subject

001 maths
001 english
001 geography
002 maths
002 english
002 geography
....


I would like however to input the results of my students in a form, which
has the following
layout

student maths english geography
001 ... ... ...
002 ... ... ...

There is however a second difficulty. I have different classes, and those
classes have different
number of subjects. This means that my class 5A has 9 subjects, but for
instance class 4C
has 13 subjects.

Can someone tell me how i can do this ?

thanks,

Steven
 
T

tina

i'm wondering about your tables design. let's forget forms for a minute, and
first make sure that you have a normalized table design. from your
description, sounds like you should have a minimum of five tables, along the
lines of

tblClasses
ClassID (primary key)
(the primary key field would probably hold your values 5A, 4C, etc.)
(other fields that specifically describe a class)

tblSubjects
SubjectID (primary key)
SName (math, english, geography, etc)
(other fields that describe a specific subject)

tblClassSubjects
ClassID (foreign key from tblClasses)
SubjectID (foreign key from tblSubjects)
(use the two fields above as a combination primary key, or add an AutoNumber
field as the primary key field)
(any other fields that describe a specific subject *in a specific class*)

tblStudents
StudentID (primary key)
FName
LName
ClassID (foreign key from tblClasses - *i'm assuming that each student is in
only one class*)
(other fields that specifically describe a student)

tblStudentGrades
StudentID (foreign key from tblStudents)
SubjectID (foreign key from tblSubjects)
(if you're only recording one grade for each student in each subject, use
the two fields above as a combination primary key; otherwise, you can add an
Autonumber field as the primary key field)
Grade
(any other fields that describe a specific grade in a specific subject, for
a specific student)

tblClasses and tblSubjects have a many-to-many relationship. this is
resolved with the linking table tblClassSubjects. set a one-to-many
relationship between tblClasses and tblClassSubjects, linking on the ClassID
field. set a one-to-many relationship between tblSubjects and
tblClassSubjects, linking on the SubjectID field.

set a one-to-many relationship between tblClasses and tblStudents, linking
on the ClassID field (this is per the assumption noted above).

tblStudents has a many-to-many relationship with tblSubjects. this is
resolved with the linking table tblStudentGrades. set a one-to-many
relationship between tblStudents and tblStudentGrades, linking on the
StudentID field. set a one-to-many relationship between tblSubjects and
tblStudentGrades, linking on the SubjectID field.

to enter grades for your students, you'll probably need some sort of
form/subform setup, that will also use comboboxes in appropriate places. how
you set that up will depend on how you want to enter the grades - for
instance, "math grades for all students in all classes" or "subject grades
for students in a specific class".

hth
 
J

John Vinson

I would like however to input the results of my students in a form, which
has the following
layout

student maths english geography
001 ... ... ...
002 ... ... ...

You can base the form on a Crosstab query, *for display only* - it
won't be updateable.

To get an updateable form in this layout you'll either need a
denormalized temporary table, or an unbound Form with a fair bit of
VBA code to parse the labels and update the normalized tables.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
S

Steven Verschelde

is there then someone who can help me with the setup of
that denormalised temporary table or that unbound form with
vba ?

thanks,

steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top