Page 1 of 1
Create subform for bridge table whit 2 foreign key
Posted: Thu Aug 19, 2021 5:19 am
by jaimeandres3
Hello.
I have 2 foreign key in table materiasa
I create subform, nuBuilder need a primary key.
How can I make the subform for table materiasa?
Attachment designer and structure tables.
Re: Create subform for bridge table whit 2 foreign key
Posted: Thu Aug 19, 2021 10:12 pm
by nac
Hello jaimeandres3,
I hope I have understood your question correctly.
Your table 'materiasa' looks like the link in a many-to-many relationship between 'materias' and ' alumnos'. You would probably need to have two separate parent forms with a subform for materiasa in each. Have you tried to make a simple wireframe of what you want the forms to look like? That could help to clarify what views you will need to create.
You can use views as the data source for a subform. The view needs to be updatable if you want to edit and save the objects in the subform. You can read about updatable views at
https://dev.mysql.com/doc/refman/8.0/en ... ility.html
Make sure that the view contains the primary key for the table (in the view) that you wish to update and use this for the primary key in the form design.
You can check if your view is updatable by running:
Code: Select all
SELECT table_name, is_updatable FROM information_schema.views;
Neil