Create a table with the subform counters

Tagged: 

Viewing 3 reply threads
  • Author
    Posts
  • March 16, 2025 at 8:04 AM #51717

    pierrot_rennes
    Participant

    Hi,

    I have a database with 4,400 records spread across several subforms.
    I would like to create a table-based form to count the totals of certain fields in the subform records.
    Is it possible to retrieve the column count value, and how do I build the form? Is there a script?
    Thank you for your help.

    Attachments:
    You must be logged in to view attached files.
    March 17, 2025 at 1:21 PM #51720

    Brendan
    Keymaster

    Hi Pierrot,

    Yes, you would need a script to get the counts of the individual forms and searches.

    I should make it easier to get those counts, but for now something like this should work:

    function getCountsOfFormRecords() {
       let theForm = document.getFormNamed("The Form");
       let theFormRecords = theForm.getRecord();
       return theFormRecords.length;
    }
    getCountsOfFormRecords();
    
    March 19, 2025 at 7:24 AM #51723

    pierrot_rennes
    Participant

    Hi Brendan,

    Thanks for your help
    I tried it, but it didn’t work.
    I probably didn’t understand how to insert or modify the script.
    Here’s a screenshot.
    I assumed I had to insert the form name into the script.

    Attachments:
    You must be logged in to view attached files.
    March 19, 2025 at 11:44 AM #51725

    Daniel Leu
    Participant

    It should say getRecords() with an _s_.

Viewing 3 reply threads

You must be logged in to reply to this topic.