Greg58 Posted October 8, 2020 Posted October 8, 2020 I have a STUDENTS (parent), and SPORTS (child) table. The relationship id STUDENTS_ID in the STUDENTS table, to STUDENTS_FK in the SPORTS table. I have a SPORTS portal in the STUDENTS table showing the sport name. Can I make the sport field in the portal a dropdown list to select various sporta for various students?? Thanks.
comment Posted October 8, 2020 Posted October 8, 2020 2 hours ago, Greg58 said: Can I make the sport field in the portal a dropdown list Why not?
Greg58 Posted October 9, 2020 Author Posted October 9, 2020 The problem I have is probably a very basic error. I can create the dropdown list in the portal OK, but when I add a second student and select a sport it created a duplicate of that sport in the sport table!! I have attached the file. Thanks for any advice. StudentSportForumQuestion.fmp12
bcooney Posted October 9, 2020 Posted October 9, 2020 You should have three tables. students<- StudentSports-> sports The portal should be based on the join table, Studentsports. Fields in the join table are studentid, sportid and ant other attributes of this combo. Level?
comment Posted October 9, 2020 Posted October 9, 2020 I don't detect any problem in your file. When you add tennis to both Greg and James, you will have two records in the Sports table with "Tennis" in the sport field: one with student_ID_FK = 1 (Greg) and the other with student_ID_FK = 2 (James). That is as it should be. Your Sport table is actually a join table between Student and a table where each sport would be a unique record - a table which you don't have and don't really need (unless you have something to record about each sport as such, other than its name).
Recommended Posts
This topic is 1562 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now