Hi
What is the best way to make a form that has 3 tables (A,B,C)
Since two tables (A,B) populate their Pk for a third (C)
Could someone give an idea of the best way to do this on a screen
Tia
Printable View
Hi
What is the best way to make a form that has 3 tables (A,B,C)
Since two tables (A,B) populate their Pk for a third (C)
Could someone give an idea of the best way to do this on a screen
Tia
Not enough info. There are several ways to structure a form with one or more sets of data. Would need much more specific info to give any real help here.
Currently I am working on a project that uses 3 tables and displays them on one form. Lets call one table the parent and the other two children.
Both of the child tables contain the PK from the parent table
My form has some text fields at the top which hold the data from the parent table.
Below that is a small flexgrid which holds data from the first child some of which is hidden from view.
Below that is another small flexgrid which holds data from the other child some of which is also hidden from view.
The stuff that is hidden from view are things like the RecordID number and the ParentID number for example.
I do not know if this will help you any or not.
btw There is no data binding in use, all fields and grids are populated via code. All additions, edits and deletions are also done through code.
Thank you
But would like something like
Attachment 143357
Can't say as I have no idea what kind of data may be in the tables, how you need to display it nor what you want to do with it.
What you posted looks like just two list boxes with arrows to move items from one to the other. That is pretty far from looking like three tables.
Again you need to give some specifics if you would like some guidance.
I must to save in table C the pk From tables A and B
Attachment 143359
tia
Still no specifics. No idea what or how many fields you are talking about or how the tables related to one another. All you mention is PK and tables A,B and C. How can anyone possibly give you advice on how to create the form without any information about the data which needs to be displayed and/or manipulated on it.
as DataMiser says...
however who knows ? maybe :
a grid with all the records from table A on the left
a grid with all the records from table B on the right
a grid in the middle a bit below the headings of A and B
to show the result of the many to many relationship between A and B (table C)
a commandbutton to put the PK 's from A and B in C
the PK of C has to be the combination of the PK's from A and B that are put in C
to actually put a PK of A and a PK of B in C
the user has to select a record from A and a record from B, and click the commandbutton
your code then has to put the PK's of A and B in C
and show the result in the grid of table C
seems simple to me, and very intuitive to the user
be sure if the user choices a combination of PK's of A and B that already exists
to politely inform the user that combination already exists
and nice would be to highlight that combination in C
but of cource, if there is not a many to many relationship between A and B
my suggestion will give totally unwanted results
What is PK