No announcement yet.

Multiple line data entry

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple line data entry

    Hi Everybody,

    This is a simple system to keep marks of students. I have the following tables:
    student(student_id, name)
    subject(subject_id, subject_name)
    student_subject(student_id, subject_id)
    marks(student_id, subject_id, score)

    I want to be able to enter marks in the format given in the attachment (I choose the subject, in this case Maths, id = 1, it gives me a list of all those who have taken Maths, id = 1, I enter the marks of ALL Students in the text boxes, and then I submit).

    I cannot figure out how to do that??DataEntryMarks.jpg

  • #2
    Maybe you could create a temporary table first for marks.
    Then you create a multiple rows form from that table.
    Add a select field for the subject, and when the select field is changed, save all student_ids with that subject_id in temp_marks, (you can also set the selected subject_id as global variable for the where condition in the form), and reload the form.
    Then on after update event, move the rows from temp_marks to marks table. Then truncate the temp_marks.

    Or you can directly save it to marks table. But I personally suggest a temporary one, as you can add a function to delete the records from temporary when you want to cancel the subject_id selection.

    Just a suggestion though, I don't know if it will work on Scriptcase.