Using Subforms

Viewing 4 reply threads
  • Author
    Posts
  • July 7, 2025 at 12:36 PM #52630

    Steve-Kai Vyska
    Participant

    Hello everyone,

    i was looking for a Databalse on Mac that was something like Access or filemaker and I must say that I love this one. It is easy and works great.

    But I got one Question. From both other programs I was used to connect the Date via IDs. That was great so you could use cascade forms. Is there something like that possible in Tab forms pro.

    I.E.

    I want to make a Databalse for tenants. For that I have three Forms:

    1. House (general Data from the House like Adress etc
    2. Apartment (floor, Kitchen etc.)
    3. Tenant

    The Apartment form has the tenant as sub form. That works great. The House form has the apartment form as subform, which also works great without the need to edit something spezial.

    But:

    When I open the house form, I get shown the right apartment-data but the last field, which is shown because of the Tenat form is empty. is it possible to show some data here?

    Sorry for my English I’m from Germany. so this is not very good.

    Thanks for any help

    Steve

    Attachments:
    You must be logged in to view attached files.
    July 7, 2025 at 5:20 PM #52639

    Daniel Leu
    Participant

    That has always been a challenge to show data that is coming from a linked form that is linked to another form. But thinking about this again, I found a solution :-)

    First, you have to enable ‘show reverse relationship’ on all linked fields.

    Then, in the house form, add a field script that returns the record id of the house record (house_id). Then in the tenant form, add another field script that returns the record id of the house record (house_id). To do this you have to traverse the linked fields back to the apartment and then to the house.

    Now in the house form, change the tenant linked field type to ‘joined’ and use the two house_id fields to link the two form.

    Now you can see all the tenants and can directly select them in the house form. When creating a new tenant or assigning one, you might have to click ‘refresh records’ to get the updated data!

    Please have a look at the attachment that shows this functionality at work.

    Another approach would be following:
    In the apartment form, add a field script that returns the name of the tenant:

    function tenant() {
    
        const mieter_id = 'fld-3bad25ed396f42e49da9780dd86d1920';
    
        const mieter__name_id = 'fld-a255f473fd744c398134add2a87a3cc9';
        const mieter__vorname_id = 'fld-ba1a0292eb07418fae85a894f94d6670';
    
        let mieter = record.getFieldValue(mieter_id);
    
        if (!mieter || mieter.length == 0) return '';
    
        // use first tenant
        mieter = mieter[0];
    
        // get names
        const name = mieter.getFieldValue(mieter__name_id);
        const vorname = mieter.getFieldValue(mieter__vorname_id);
    
        // return name
        return vorname + " " + name;
    }
    
    tenant();

    Then add this field in the apartment listing of the house. This way, you see who’s in which apartment, but you don’t have the direct link in the tenant table.

    Attachments:
    You must be logged in to view attached files.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    July 9, 2025 at 10:16 AM #52657

    Steve-Kai Vyska
    Participant

    Thanks for the solution, I’ll need some Time to understand it / look in the File you send. Thanks for the Hel.

    Steve

    July 9, 2025 at 12:06 PM #52658

    Daniel Leu
    Participant

    The idea is to link the tenant to the house using the join relationship with the record id of the house as the connecting element. Each record has an id, but it has to be exposed first. For the tenant it’s a bit more complicated since the house id first has to be found.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    September 4, 2025 at 8:55 AM #52929

    Steve-Kai Vyska
    Participant

    Thanks for the Help, I just found out how to use it, but now I got a new Question. When I Use Subforms, I can activate “Umkehrbezihung einblenden”. Using this, I get one of the Filed shown, from the SubForm, but I can not figure out, which one is shown there?

    Could someone tell me how I can select which one is shown, or how to make a subform the way, that the field I want to show is the selected field.

    Sorry I guess the question is silly and to normal user logial, but I do not get it.

    Greetings

    Steve

    Attachments:
    You must be logged in to view attached files.
Viewing 4 reply threads

You must be logged in to reply to this topic.