|
-
Dec 16th, 2016, 01:47 AM
#1
Thread Starter
Fanatic Member
Form when PK two tables populate a third, How do ?
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
-
Dec 16th, 2016, 06:32 AM
#2
Re: Form when PK two tables populate a third, How do ?
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.
-
Dec 16th, 2016, 07:37 AM
#3
Thread Starter
Fanatic Member
Re: Form when PK two tables populate a third, How do ?
Thank you
But would like something like
-
Dec 16th, 2016, 09:24 AM
#4
Re: Form when PK two tables populate a third, How do ?
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.
-
Dec 16th, 2016, 09:37 AM
#5
Thread Starter
Fanatic Member
Re: Form when PK two tables populate a third, How do ?
I must to save in table C the pk From tables A and B

tia
-
Dec 16th, 2016, 10:35 AM
#6
Re: Form when PK two tables populate a third, How do ?
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.
-
Dec 16th, 2016, 11:21 AM
#7
Re: Form when PK two tables populate a third, How do ?
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
do not put off till tomorrow what you can put off forever
-
Dec 16th, 2016, 12:59 PM
#8
Hyperactive Member
Re: Form when PK two tables populate a third, How do ?
-
Dec 16th, 2016, 01:23 PM
#9
Re: Form when PK two tables populate a third, How do ?
 Originally Posted by I Love VB6
What is PK
Primary Key (of a database table)
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|