First, do not attempt to sort a table for anything other than temporary
convenience, especially during the design process. The sort order will not
"stick". I prefer to use queries to organize data. Make a query based on
the table, select a field, and choose Ascending or Descending for Sort.
Above all, DO NOT make tables that duplicate information in other tables.
Use queries to combine tables, but I don't think that is quite what you
need. You may be stuck in thinking of Access almost as an elaborate
spreadsheet. Relational databases are entirely different from spreadsheets,
and must be approached differently.
Second, relationships are built based on fields that you add for the
specific purpose of creating relationships. You are on track with a
separate table for Students, Staff, and Incidents. A simple version of the
database may use table design something like the following:
tblStudent
StudentID (primary key, or PK)
LastName
FirstName
etc.
tblStaff
StaffID (PK)
LastName
FristName
etc.
tblIncident
IncidentID (PK)
StudentID (foreign key, or FK)
StaffID (FK)
IncidentDate
TimeOfDay
IncidentDescription
tblConsequences
ConsequenceID (PK)
IncidentID (FK)
ConsequenceDescription
The PK is assigned in Table design view. The FK is a field of the same type
as the corresponding PK. For instance, if StudentID in tblStudents is a
Number field, StudentID in tblIncident must be a Number field. If the PK is
autonumber, the FK can only be Number. The FK is established by its
relationship to a PK field. Establish relationships between the PK fields
and the corresponding FK fields (the ones with the same names as the PK
fields). See Help for more on relationships. Be sure to click Enforce
Referential Integrity.
I am assuming that a single student can have multiple incidents, that each
staff member may be involved with multiple incidents involving several
students, and that each incident may have several consequences. This would
be a many-to-many relationship, so tblIncident serves as a junction table to
resolve this relationship. Build a form (frmStudent) based on tblStudent,
another (fsubIncident) based on tblIncident, and another (fsubConsequence)
based on tblConsequences. The form fsubIncident would include a combo box
using tblStaff as the Row Source. In form design view, drag the icon for
fsubConsequences onto fsubIncident, then drag the icon for fsubIncident onto
frmStudents. Create an Incident for a student, then invent a Consequence.
Click the New Record arrow at the bottom of tblIncident, then add a couple
of consequences. Do the same with another student. Get familiar with how
this works. Remember that you do not need to populate the FK fields. They
will be populated with the PK from the related table. Probably best not to
have the FK fields on the forms.
Another possibility is that an Incident may involve more than one Student,
in which case you need to alter the design. Another table
(tblStudentIncident) would be added. It would contain StudentIncidentID as
the PK, and have IncidentID as the FK. The main table would be tblIncident,
and the main form frmIncident; the subform would be based on
tblStudentIncident. Students and Staff would be selected from combo boxes
on fsubStudentIncident, and a subform based on tblConsequences would be
added (same as before). Students and Staff would probably be selected from
combo boxes. Something like that.
What if the consequences are different for each Student in an incident
involving more than one? All of these problems are solvable, but you have
chosen a complex project on which to cut your teeth. Clarify the details
and the general approach you need. In specifying table fields, all that is
needed for explanation is something like I have suggested. It is not
necessary, for instance, to specify address fields and so forth for Students
and Staff.