I have four data blocks for four tables, lets call them blocks A, B, C, D
Block A is a master block and block B is a detail block, block B holds a foreign key from block A (ofcourse)
Now when i choose in a query data from block A it lists also data from detail block that is corresponding, but now.....
detail block B also holds another foreign key from block C which takes his key from block D. and
i want to make a form that will, when i query master block A, show some data from block B, C and D that is
corresponding to block A.How do i do that?
In each Data Block there are three nodes - triggers, items, and relations. The relations node is what you use to link the master to the detail. If you highlight the Relations node and press create a window will open to create your "New Relation". The master block is already entered because it is the block that you are currently in. You can then pick a detail block by pressing the "select..." button or just type the name of the block in. So if you did this in block A, you would enter B as your detail block. You will then need to enter a join condition. If the PK in block A is named A_DETAIL and the FK in block B is the same name, then you can just type in A_DETAIL, press OK, and the relationship will be automatically created. If the names are different then you could put in a join condition like A.A_DETAIL = B.B_A_DETAIL (whatever the names of the blocks and items are). You can then repeat this process for every parent-child relationship.
In the example you mentioned B is the child table of master tables A,C and C is the child table of D.
Now in the block properties of A create a relation with B by giving equi join.
Similarly in the B block create relation with C,D (if B has the foreign key of D) else create a similar relation between B and C, C and D.
Now if query master block A, show some data from block B, C and D that is corresponding to block A.
I joined every parent/child in master/detail relationship (again like I did before) and when I run the form and query A it only shows details from B, and details from C and D are empty.
So when I make master/detail relationship can I change it this time and make child-the master and parent-the details or something?