April 6, 20196 yr Good afternoon, (I'm not sure this is the right section, but seemed the most appropriate that I can find.) I have three fields ("type", "client", and "expense"). Each field has 10 repetitions. I have a button that will clear out the n'th repetition of all three fields - so the whole line is blanked should the user need to do so. What I would like to do is then remove that empty line, moving all the data from all subsequent fields "up" one. (n-1), thus keeping the list compact and free of blank lines. I did write a loop that did this, but it was very clumsy, and thought that somebody may know of a cleaner way using existing functions and smarter (than my-) logic to achieve this please? Many thanks in advance if anybody has any ideas. Greg
April 6, 20196 yr I would suggest you solve this by changing your structure: instead of repeating fields, use records in a related table. Then you can simply delete a record and the gap in the portal showing the related records will close automatically, without you having to do anything. Not to mention numerous other advantages offered by having a proper relational structure.
April 6, 20196 yr Author Hi Comment, Thank you, and yes, you are right - a portal would be a better approach. The problem here was becoming more theoretical and experimental to me now than anything. Cheers, Greg
April 6, 20196 yr Well, in theory, assuming that any repetition of the three fields would be either empty or non-empty in all three of them, you could gather the remaining values into 3 variables using the List() function (which skips empty values). Then loop populating all repetitions with the corresponding value from the corresponding variable. But really, this is not the best way, and hasn't been ever since Filemaker went relational in version 3 (1995).
April 6, 20196 yr Author Hi Comment, Thank you. Loud and clear. lol I am using the portal method and it works fine, but I was revisiting another part of a solution (I inherited) that had the repeating fields and was probably just wasting time trying to find a solution to it. Let's close this one. I shouldn't be wasting time anyway. Thanks again. Greg
Create an account or sign in to comment