Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    132

    Unanswered: is this smart form possible?

    There is a table named “ student_score” like the following:
    Code:
    ID   studentname       score           subject
    
    12        jack           A             Biology    
    13        jack           c             politics    
    14        jack           B             math    
    15        jack           A             physics   
    16        Steve          B             math
    17        Steve          A             politics
    The data is recorded by a form named: “score_entery”. Is it possible that when I open the form all three fields are blank and ready for data entry, but when I put next and the form goes to the next record, the student name field automatically gets the data of the previous record? if this works I wont have to choose student name after the first record and i will only put the subject and score.
    Thank you
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    why would you put the student name in the same row as the student ID? if you have the student ID by defintion when you need it you can get the student name using a JOIN in a query. assuming you have defined relationships the query dsesigner will even form the join for you.

    FWIW what you are proposing violates normal form. the student name is derived data. And as such shoudl bve pulled when required from the student table. why. well what happens if say half way through adding the marks you finm the student is no longer called Steve, but is now called Stephanie. how woudl you go about correcting your results table.

    If you need a transcript of the data as it was at the time the row was entered then its perfectly acceptable to store what may seem at first glance derived data (things like product descriptions or prices or sales tax computations) in an order detail are a classic case of this. but I don't see that being true in this case
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2012
    Posts
    132
    well, i was just thinking to find an easier way to prevent inserting some repetitive data, which is "student name" in this example. If we start recording the data of another student, Stephanie for example, the user still have the option to change the student name.
    oh, and the ID in this example, is the ID of the record and not the studentID. i though this is not a problem.
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I think, you have some design issues. what id expect in this sort of situation is:-
    a table for students
    a table for courses
    an (intersection) table that stores the marks/grade for students on specific courses

    you shgoudl; only use an auto numbered /autogenerated value if there is no suitable obvious/natural key or there are several so called candidate keys or if the obvious natural key is too long too complex

    so in this case for your scores table the obvious natural key is
    student ID AND course ID as a composite primary key. why is that preferable, well primarily as by making the specific data attributes the primary key it also enforces a rule that there can be no other results recorded for the same student and course pairing. by using an autonumber key there is risk that ccan occur unless you take other action. its self documenting

    as to re entering data, yess you cna hild over values fromt he last row recorded, however I'd suggest that indicates you haven't really grasped the idea of a windowing GUI. what I'd expect your form design to be is to have say combo or list boxes storing details of students and another one for courses. the user selects the required value from those limited choices. the reason well there is less redundancy users select from known good values.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •