Topic: Relationship many to many

Hello. I like what I see here, simple and straightforward way to create a database.
But I'm struggling to make a many to many relationship, how should I solve it.?
Someone who has created something that shows how to solve this

frehak

Re: Relationship many to many

Hi and Welcome to MVD,
Here is a link to a project that Dmitry (the writer of MVD) put together to demonstrate many-to-many relationships.
http://myvisualdatabase.com/forum/viewtopic.php?id=1429
It might answer some of your questions.
If not, just post another question and I'm sure there will be someone who can help.
Regards,
Derek.

3 (edited by h.fremstad 2017-01-29 17:55:46)

Re: Relationship many to many

Can not see the connection here. Are unsure if this is what I'm looking for. It is possible that the best solution would be to use a lockup function in Table Grid, but can not find any way to do it. Creates a small database, which I publish here later, so everyone can see my problem.

Here are the problem, if anyone has a solution, I'll be happy.  https://dl.dropboxusercontent.com/u/108 … R%26F-.zip

frehak

Re: Relationship many to many

Hello Frehak,
Please see the attachment which I believe solves your problem.
In your project, you have correctly created 2 relationships between the 'overview' table and the 'part' table (one for 'part A' and one for 'part B').   
In MVD, the description of the part in the first relationship (Part A) is retrieved into the tablegrid without any additional work. 
However, you have to manually retrieve the description of the part in the second relationship (PartB) (and for any further relationships). 
The easiest way to do this is to use a 'calculated field' with an sql statement to retrieve the description. 
Have a look in your 'overview' table at the calculated field 'cfpartB' that I've created and you will see how this is done. 
I have then included the calculated field in form1.tablegrid4 and it now should display as you want.
I hope this helps.
Derek.

Post's attachments

Attachment icon R&F-.zip 406.27 kb, 780 downloads since 2017-01-29 

Re: Relationship many to many

You're a genius, thank you. I wish there was a more complete manual, which also deals with the formatting of the columns in Table Grid.
Thanks again.

frehak

Re: Relationship many to many

Hi Frehak,
Glad it helped.
As you may already know,  a good place to get some help on MVD is - www.myvisualdatabase.com/help_en/
But I have found most help here in the forum by downloading other users' example projects and seeing how they have approached things, by searching through the forum topics and by submitting questions if I can't find the answer - there is almost always someone who will try to help.
Regards,
Derek.