Conditional formatting of attendance portal
I am making an attendance portal.
I mark students present or absent by pressing a red or green button beside the students name. This runs a script which creates a new record in the attendance table and sets the attendance field in this new record as absent or present. This presents to me a number of problems.
The relationship is meetings::fk_student id ----- attendance::fk_student id
When I mark a student present or abscent I want to use conditional formatting to change the colour of the students' names depending on their absence or presence.
This isn't working very well. I'm using If(attendance::attendance = "Present") to make the field turn green. This works sometimes. But it turns all of the fields green. I think this is because there are several records for each student in attendance.
This brings me to my second problem.
What sort of relationship do I need to set up so that each student is related to only their up to date attendance status?
To sum up: How can I make my conditional formatting work?
What sort of relationship do I need to set up between my meetings records and attendance records?