Do multiple records for one source need to be linked manually?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm designing an Access database. I must enter multiple and various contact
data for each student in our school: personal info, parent info, school
district info, medical info. I also need to input data regarding their test
scores, class schedule, attendance, etc. (It's a small school so that's not
so bad as it sounds.) Do I need to manually input the student's id number
across tables of this data? That makes data entry a cumbersome process,
constantly cross-checking back to the source table.
 
hi,
you should have a table with all of the info unique to
that student ie id, name, adress, other personal stuff.
all of your other table should just have the id and test
scores or id and attendence or id and schedule.
I cannot see all of your data so i am being general. maybe
attendence and test scores could be combined?
results student id would be the primary key for all tables.
this way you could write queries that use several tables
and draw in student name and say test scores using the
student id as the join.
 
I'm designing an Access database. I must enter multiple and various contact
data for each student in our school: personal info, parent info, school
district info, medical info. I also need to input data regarding their test
scores, class schedule, attendance, etc. (It's a small school so that's not
so bad as it sounds.) Do I need to manually input the student's id number
across tables of this data? That makes data entry a cumbersome process,
constantly cross-checking back to the source table.

No; in fact you should not be looking at table datasheets AT ALL.
They're not designed for data entry or display; tables are for data
*storage*.

Instead, create a Form based on the tables for data entry. You might
have a Form based on the Student table for personal info, with combo
boxes for the school district; on this Form there would be Subforms
for the test scores, attendence, etc. A Subform has a "master link
field" and "child link field" which automatically keeps the StudentID
link between the tables.

Use the tools that Access provides! They're really quite powerful and
let the computer do the grunt work for you.

John W. Vinson[MVP]
 
Thanks for the input, both Anonymous and John. As you can see, I got some
seemingly conflicting advice.

So far I have set up some tables for the data that needs to be collected,
with the student id as the key field for each. I played yesterday with the
relationships, got no where.

The primary thing I am trying to avoid is having to print out, and use as a
constant reference, a paper list of students with attached id numbers (the id
numbers were generated automatically and match the sequence of input.) I
don't want my assistants entering data into the table because I feel I need
to protect it from the clumsy and over-helpful. So forms are definitely the
way to go. I've made one so far and they've used it to input 195 students,
both currently enrolled and alumni. The thing driving me mad is that I need
to add tables/forms to input the other categories I mentioned and the only
way to match the right records with the right student is to search through,
find the name, find the computer-generated id number, and then manually input
it on the additional table/record. I can't help thinking this is NOT the way
it's supposed to work.

John, are you saying what I want will occur if I simply work at making
forms, focus on them, and Access will think about the underlying structure of
the table for me? that would be cool. Way cool.

Thanks for your help.
 
Thanks for the input, both Anonymous and John. As you can see, I got some
seemingly conflicting advice.

I think I must respectfully disagree with anonymous. Each "entity" -
student, scores, etc. - should have its own table.
So far I have set up some tables for the data that needs to be collected,
with the student id as the key field for each. I played yesterday with the
relationships, got no where.

Making the StudentID the Primary Key for the Students table is
obviously correct. However, making the StudentID the Primary Key for
the Enrollment table is simply WRONG. A Primary Key is, by definition,
unique; if you want a student to be enrolled in multiple courses, it
*CANNOT* be the primary key.

Instead, the StudentID would be a *foreign* key - not the primary key
- in the related tables. Each table would have its own Primary Key,
which might be an autonumber or might be a combination of fields.
The primary thing I am trying to avoid is having to print out, and use as a
constant reference, a paper list of students with attached id numbers (the id
numbers were generated automatically and match the sequence of input.) I
don't want my assistants entering data into the table because I feel I need
to protect it from the clumsy and over-helpful.

Your assistants should never even need to *SEE* an ID number, unless
they use them already. If the ID number is an Autonumber then the ID
should be concealed.

The assistants likewise should never see a table datasheet. Table
datasheets are NOT designed for data display or for data entry.
So forms are definitely the
way to go. I've made one so far and they've used it to input 195 students,
both currently enrolled and alumni. The thing driving me mad is that I need
to add tables/forms to input the other categories I mentioned and the only
way to match the right records with the right student is to search through,
find the name, find the computer-generated id number, and then manually input
it on the additional table/record. I can't help thinking this is NOT the way
it's supposed to work.

You are correct. The way it's supposed to work is that you use a
Subform for the other data.

If you have an Enrollment table with a StudentID foreign key, you can
base a Subform on the enrollment table, using StudentID as the master
link field and child link field. The Subform will now display only
those enrollment records for that student; new records added to the
subform will automatically inherit the StudentID on the currently
selected mainform record. The ID need not be visible on either form
for this to work (and, if it's an autonumber, I'd recommend that it
not be made visible).

You can also use COmbo Box or Listbox controls to advantage - for
instance, if you're adding an enrollment record to a table containing
a StudentID and a CourseID as a joint two-field primary key using a
subform, you could have the StudentID filled in automatically by the
master/child link field; and have a Combo Box bound to the CourseID.
This would *store* the numeric, meaningless CourseID but *display* the
human-readable course name.
John, are you saying what I want will occur if I simply work at making
forms, focus on them, and Access will think about the underlying structure of
the table for me? that would be cool. Way cool.

Well... that would be nice, but Access isn't quite up to "thinking"
yet! However, it certainly provides some easy to use (once you get the
hang of it) tools which work tightly with the underlying table
structure.

That's one reason why you MUST get the underlying table structure
correct FIRST - otherwise the superstructure will be built upon the
sand. You might want to describe your table structure a bit to be sure
you're on the right track!

John W. Vinson[MVP]
 
Thank you very much for all your help.

So far I have a table that lists students by id # (the key field,)
name(first and last,) address and phone, the school district from which they
come, and the school district rep. I've used combo boxes for those fields
that have just a few possible answers (MA, NH, ME for instance,) input masks
for the phone numbers and zips, and a yes/no field to sort those currently
enrolled from the alumni. I made a form corresponding to this table for my
assistants to input data. They've been at it full blazes.

I have figured out already I should have put the school district info into
its own table but will tackle the problem of how to abstract that data later.

I spent time today in Word just trying to list the data fields I need and
sort them into categories. I thought I knew what I wanted but realized as I
got deeper into this that the design, as you wrote, needs a solid foundation.
That process made me think about the key fields. It seems to me that every
unique person or thing needs its own key id. (Sorry if I'm being thick-headed
but things which should be obvious often only hit me when I've had to use
them.) So each kid has a key number, but each school district should have a
key number, each school district rep, each education plan, each assessement
and set of scores, each class (English 9, quarter 3, 2005) needs its own key
id #. Right? And every time I have a new key I have a new table?

I'm having the most trouble trying to understand this part. > making the
StudentID the Primary Key for the Enrollment table is simply WRONG. A Primary
Key is, by definition, unique; if you want a student to be enrolled in
multiple courses, it *CANNOT* be the primary key. Instead, the StudentID
would be a *foreign* key - not the primary key - in the related tables. Each
table would have its own Primary Key, which might be an autonumber or might
be a combination of fields.>

A foreign key is key field data used in a subsequent tables, but not
identified in the new table as a key? In a one-to-many relationship, the
student is the one and the classes he takes is the many. So it all needs to
be set up so that the key fields which identfy the particular class are
records in a table which details all the classes the student takes while
enrolled at our school. I don't know; this whole part blows my mind.
Especially when I try to think about setting up forms for teachers to input
assignments and grades and attendance.

You know, I could buy a software package to do all this for us for $8k, with
a $2k annual tech assistance fee. But that's my book and supply budget for
the year so I'm on a mission here!


I agree with this: If the ID number is an Autonumber then the ID should be
concealed. They are not helpful to my staff or me, I don't want to be
distracted by them.

I agree with this, too: The assistants likewise should never see a table
datasheet. Again, guaranteed to freak my assistants out. They already think
Access if voodoo.

Subforms. I tried to use my How to do Everything with Access 2002 book. I
ended up in a coma. I'm just going to have to take a copy of my table, get
into the wizards available, get down and dirty, and try it.

Thanks again, John. You've been a bit of sanity in this endeavor. I hope I
don't get defeated.

LSA teacher in NH
 
Thank you very much for all your help.

You're welcome. That's why I volunteer here.
So far I have a table that lists students by id # (the key field,)
name(first and last,) address and phone, the school district from which they
come, and the school district rep. I've used combo boxes for those fields
that have just a few possible answers (MA, NH, ME for instance,) input masks
for the phone numbers and zips, and a yes/no field to sort those currently
enrolled from the alumni. I made a form corresponding to this table for my
assistants to input data. They've been at it full blazes.

I have figured out already I should have put the school district info into
its own table but will tackle the problem of how to abstract that data later.

Shouldn't be hard: you can use a MakeTable query selecting distinct
districts. We'll get to that.
I spent time today in Word just trying to list the data fields I need and
sort them into categories. I thought I knew what I wanted but realized as I
got deeper into this that the design, as you wrote, needs a solid foundation.
That process made me think about the key fields. It seems to me that every
unique person or thing needs its own key id. (Sorry if I'm being thick-headed
but things which should be obvious often only hit me when I've had to use
them.) So each kid has a key number, but each school district should have a
key number, each school district rep, each education plan, each assessement
and set of scores, each class (English 9, quarter 3, 2005) needs its own key
id #. Right? And every time I have a new key I have a new table?

Well... every Table must have a Primary Key. But it need not be a
number, and it need not be an Autonumber, and it need not be a single
field. If you have unique government-assign district numbers, or
district names, by all means use that name as the Primary Key: the
criteria for a PK are that it must be unique (no two districts with
the same name) and it should be stable and reasonably short. A 25 byte
text field that isn't likely to change would be just fine.
I'm having the most trouble trying to understand this part. > making the
StudentID the Primary Key for the Enrollment table is simply WRONG. A Primary
Key is, by definition, unique; if you want a student to be enrolled in
multiple courses, it *CANNOT* be the primary key. Instead, the StudentID
would be a *foreign* key - not the primary key - in the related tables. Each
table would have its own Primary Key, which might be an autonumber or might
be a combination of fields.>

A foreign key is key field data used in a subsequent tables, but not
identified in the new table as a key?

well, a foreign key isn't visibly distinguished in the table
datasheet. It doesn't have any key icon by it, as the PK does. It's
how it's USED that makes it a foreign key. In the Enrollment table
it's just a long integer (or whatever datatype matches the StudentID
primary key in the Students table) field, in the table like any other
field in the table.
In a one-to-many relationship, the
student is the one and the classes he takes is the many. So it all needs to
be set up so that the key fields which identfy the particular class are
records in a table which details all the classes the student takes while
enrolled at our school.

Not really. The Students to Classes relationship is NOT "one to many".
If it were you could put the StudentID in the Classes table - but
whoops, a field can only have one value, so that class could have only
one student! It's a *many to many* relationship; so you need an
Enrollment table modeling the relationship. It would have the
StudentID and the ClassID as a joint, two field Primary Key. This
table basically contains nothing but key fields (unless you need to
record other information about *this* student's enrollment in *this*
class, in which case you need other fields).
I don't know; this whole part blows my mind.
Especially when I try to think about setting up forms for teachers to input
assignments and grades and attendance.

It's all doable. It's a lot of work and will take some time, but it
can be done!
You know, I could buy a software package to do all this for us for $8k, with
a $2k annual tech assistance fee. But that's my book and supply budget for
the year so I'm on a mission here!

"It'll be a great day when schools have all the money they need and
the Pentagon needs to hold a bake sale to buy a new fighter jet!"

I'll confess, that if I were bidding a full school
enrollment/grades/reports etc. application, it would cost at least
that much. As I say... a lot of work. But I (and the other good folks
here on the newsgroup) should be able to help you do it for
free-or-cheap, and you'll get what YOU want rather than what some
committee thought would be a good idea. The downside is that you will
(to some extent) be reinventing the wheel, putting in a lot of time,
and forgoing the many person-years of time that have been invested in
the commercial apps.
I agree with this: If the ID number is an Autonumber then the ID should be
concealed. They are not helpful to my staff or me, I don't want to be
distracted by them.

I agree with this, too: The assistants likewise should never see a table
datasheet. Again, guaranteed to freak my assistants out. They already think
Access if voodoo.

Subforms. I tried to use my How to do Everything with Access 2002 book. I
ended up in a coma. I'm just going to have to take a copy of my table, get
into the wizards available, get down and dirty, and try it.

That's the best way to learn for me, certainly. There are other books
out there but there's nothing like doing it for real (with information
that is meaningful TO YOU, not hypothetical examples).
Thanks again, John. You've been a bit of sanity in this endeavor. I hope I
don't get defeated.

Just don't get snowed under! <g>

John W. Vinson[MVP]
 
Would you be willing to share a template? I love to work in Access but have
not had any formal training. I needed a database to keep track of kids that
came to a program that my church was hosting. I needed to keep personal
information on the Students as well as keep an attendance record of them. I
know how to create a Table, Query, Form, and Report. But I don't know
anything about SubForms and foreign keys and such. I have created everything
that I believe that we need but haven't been able to tie in the attendance
record. Thank You!
 
Back
Top