Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Puzzled Creating New Links
- This topic has 11 replies, 5 voices, and was last updated 11 years, 8 months ago by Brendan.
-
AuthorPosts
-
February 10, 2013 at 2:36 PM #5950
DrJJWMacParticipantI have a source Form A that is already populated by existing records. I have a different Form B. I want to link a field in Form B to a record in Form A. Form A is a database of client contact information. Form B is to be a database of private content about a given client.
When I create a One to Many field in Form B, I cannot access any existing records in Form A. I can only create new records in Form A and link to them.
By comparison, when I create a Many to Many field in Form B, I can choose any of the existing records in Form A.
Am I doing something wrong or misunderstanding the intention of the two options?
I admit, the explanation of One-to-Many and Many-to-Many links still leaves me … puzzled.
Edit
*********
OK, is this what it is all about?
One-to-Many creates ONE field that displays a scrolling list of MANY records
Many-to-Many creates a NEW field for each NEW record that is to be displayedIf so, why does a One-to-Many link not allow me to access any of the existing records in the link-from database? Why is this only possible in a Many-to-Many link?
*********—
JJWFebruary 10, 2013 at 5:31 PM #5952
RooParticipantI had trouble understanding this too.
February 11, 2013 at 2:59 PM #5958
BrendanKeymasterThis is a bit of a complex topic and relates specifically to database architecture issues.
In a one-to-many architecture, you have a list of child records which each contain a parent record ID. So the child directly knows who its parent is. Therefore, you CAN’T have a child having more than one parent since there’s only one parent record ID per child. But a parent CAN have as many children as it wants.
In a many-to-many architecture, the link between the parent and the child is stored in a separate table with IDs referencing both the parents and the children. Therefore, a child can have many parents and a parent can have many children.
In Tap Forms parlance, this translates to the requirement for you to create new records from a one-to-many link type. But in a many-to-many link type you can link to any pre-existing records from the linked form just by selecting them.
Here are two examples where each link type makes the most sense:
1. You have a patient form with a patient’s name, address, etc. The patient also has a list of examinations that have been performed on the patient. You select the right patient from the list of patients, then you add new examination entries each time they visit. You would never want those examination entries to be visible or accessible to any other patients. So a one-to-many link type is appropriate for this situation.
2. Taking the same patient form, you have a list of medications you want to assign to the patient. So you make a many-to-many link from your Patient form to your Medications form. This is appropriate because many patients can be taking the same medications. So you would want to setup a list of medications which can be shared by everyone and then just link to those so that you don’t have to enter in the same medication over and over for each patient.
I hope this simple example helps to explain the difference between one-to-many and many-to-many link types.
Please let me know if it warrants further clarification.
Thanks!
Brendan
February 12, 2013 at 9:39 AM #5967
DrJJWMacParticipantThanks. In a different lingo … a child is the external record you will view, and a parent is the form where you will view it.
Might I ask to have a different clarification statement about this on the iPad, iPhone, AND Mac versions in the link creation dialog box. Something along this line …
* Use One-to-Many when you must keep each linked record as being private to one specific record on this current form. New links will always first be created as blank records.
* Use Many-to-Many when you want to be able to link to any existing record from the other form. New links can be created blank or made to any already-existing records.I still have to puzzle over why One-to-Many requires every new link to be blank. But that is a minor issue.
Thanks!
—
JJWFebruary 13, 2013 at 3:02 AM #5970
BrendanKeymasterHi JJW,
New records are blank because you haven’t entered any data into them yet. You could always setup a default value so that at least something shows when you create the new child record.
Thanks for the wording adjustment suggestions.
Brendan
March 5, 2013 at 11:20 AM #6015
Philippe De LeersnijderParticipantBrendan,
To go further on your example of the patient and medications.
In a many-to-many you can list from ONE patient ALL his medications.
But, from ONE medication, to see ALL patients using it.
That does not work.I’m using Tapforms against Bento.
Bento does has bi-directional relations.
Meaning, changing something in the medications, immediately is available for all patients using it.Tapforms has one big major advantage, icloud sync.
I use Tapforms on iPad and iPhone, that works amazing.Please consider my question of bi-directional links.
That makes Tapforms against your competitors miles ahead.
For Bento, I would have to buy a MAC to let iPhone and iPad synchronizing.
If you would forsee bi-directional relationships, what an advantage !
Now my Bento on iPhone is unused, as I can not import anything.Greetings from Belgium,
Philippe
March 5, 2013 at 10:42 PM #6018
BrendanKeymasterHello Philippe,
Yes, adding inverse relationships is definitely on my to-do list. I just haven’t sat down yet to figure out the proper SQL queries required to make that work. Plus I have to think about how to represent them in the record details. And it should be optional, so it needs to have a switch to let the user turn that on or off.
But it’s definitely something I think needs to be in there too.
Thanks!
Brendan
March 6, 2013 at 5:45 PM #6021
RooParticipantI would certainly find this useful too.
April 20, 2013 at 10:44 PM #6144
antonvsParticipantBrendon, I’m struggling to get a parent/child one to many database working.
From reading this thread am I correct in understanding that you can’t use an existing parent table but have to set up both blank tables first then start adding records to the parent and then finally start adding child records.Regards Anton.
Bendigo, Vic. AU.April 22, 2013 at 7:17 PM #6148
BrendanKeymasterHello Anton,
You can use existing forms and link them together of course, but for a one-to-many the child records must be created from a record in a parent form. So you would create a parent record, then one of the fields will be your relationship. You tap that field, then start adding records there. That’ll be your child form.
If you have existing records in your child form that you want to link to your parent form, then use a Many to Many link type.
Thanks!
Brendan
April 22, 2013 at 8:06 PM #6151
antonvsParticipantOk. Thanks Brendon, got that. However in the patient visits example. You would be able to see any number of visits a given patient has, but if you look in the Visits table all you see is all visits dates etc without you knowing which enteries belonged to what patients, so is there a way of reading fields like surname, fname from the parent table into the child (visits) record without having to add these manually at the time of adding a new visit. I’m thinking here of how MS access works once you have a link you can have any field from the parent show automatically in the child. Or is this outside the scope of TF.
Again using this example, this would be required say if one wanted to know the names of all the people who were seen on a given day. Without having to go to each patients record one by one.
Cheers Anton.
April 22, 2013 at 11:35 PM #6154
BrendanKeymasterHello Anton,
That’s out of scope for Tap Forms at the moment, but it’s something I’d like to add for a future update. There’s just sooo many new things to add, it’s hard to find the time to implement everything. Plus I don’t want bloatware, so I’m very selective of what feature requests I implement. But the ability to display inverse relationships is one that would be good. Right now you’re right, when you view the child form directly you don’t know which patient each record belongs to. You can hide the child form from the main Forms list by using the Hide Form option on the Edit Form screen. That’s what that was designed for.
Thanks,
Brendan
-
AuthorPosts
You must be logged in to reply to this topic.