Think you might need to create a Jointable between CLASS and STUDENTS:
Set a field into your CLASS table as _kp_class
double click the field go to AUTO_ENT tab and select serial number
Then make a table JT_01_CLASS_STUDENTS
make a field called _kf_class_students
and another field groups
Now join the two tables by
CLASS T.O. JT_01_CLAS.. STUDENTS
_kp_class -----> _kf_students
Hope this helps
Thx for the reply kilbot.
I'm having a real hard time understanding self joined tables...
By the time you answered, I partly solved my previous problem and changed my DB structure.
same 3 tables
- students::groupID >----- class::groupID (allow creation of records in Attendance)
- students::studentID ------< attendance::studentID
inside Class layout, portal showing students depending on which groupID is selected in this particular class.
On each row, there is a Attendance::status (absent or present). when i select one, it creates an attendance record for this class/student/date (via lookup value inside Attendance).
This looks much cleaner than scripting it and it solves the previous checboxes problem since the attendance status is not related to the groupID (like my previous problem).
New problem shows up: if I create a new class for the same group (let's say 1 week later), it finds the attendance status from the previous week, it does not create new attendance record...
So sorry for the noobism, but I gotta start somewhere ;)
Thx for the help !
---< means "one to many"
Students::StudentID = Attendance::StudentID
Class::ClassID = Attendance::ClassID
Students::StudentID and Class::ClassID are auto-entered serial number fields. The matching fields in attendance are number fields. "Allow creation of records via this relationship" should be enabled for attendance in the Class--<Attendance relationship.
A text field, AttendanceStatus can be defined as a text field and formatted on the layout with a value list of "Present" and "Absent". A date field, SessionDate, can be defined in Attendance to record the date of the class session.
Now, to record attendance, you can put a portal to attendance on the Class layout. Include the StudentID, AttendanceStatus and SessionDate from the attendance table in this portal. You can also include fields from students such as a name field from the Students table as needed. Format the Attendance::StudentID field as a drop down list or pop up menu of StudentID's from the Students table with student names listed as a second column in this value list. To Mark a student as present, you go to the bottom blank row of the portal and select them in the studentID field's drop down. Then enter the date (this field can also be set to auto-enter today's date). Then select "Present" as their attendance status. Do the same for absent students, but select "Absent" or you may be able to just do nothing. (Depends on your report needs).
Once you have those basics working. We can talk about a script that sets up the entire roster of students for each class for the current day's session and a portal filter that can be used to limit the attendance records so that you only see one day's attendance record at a time.
PS. You've mentioned "groups" in your post, but haven't elaborated. Depending on whether a single class has more than one group and/or whether each "class" is a specific meeting on a specific date or a specific subject/skill level that meets on a series of dates, we may need to further modify this structure.
All good ! thank you so much.
I got a script running that creates the attendance records based upon which group (hence the groupID field) a class is created for, so that my portal gets filled with the correct students.
Everything makes much more sense suddenly; thank you so much for your fast replies guys !