November 22, 200817 yr Hey everyone. I put a filtered portal on a layout; in the global filter field the user can key in his search term and gets a list of appropriate records. Works great. Two questions: 1. I’d like to make it possible for the user to show all records. The only thing I can imagine at the moment is to put a separate button next to the filter field attached to a script like „show records from the not filtered table“ (= the one that is the basis for the self-join). 2. To make it possible for a user to key in just the first few letters of a record’s title (truncated, like in find mode), I set up my relational key to the filter field like Left ( Title ; 1 ) & "¶" & Left ( Title ; 2 ) & "¶" & Left ( Title ; 3 ) & "¶" & Left ( Title ; 4 ) & "¶" & Left ( Title ; 5 ) & "¶" & Left ( Title ; 6 ) & "¶" & and so on... So, when the users keys in fu he receives fully, also when typing in ful or full. This works quite well, I just wonder: Is this really best practice? Seems to make my database quite large, as I have to go all the way to Left ( Title ; 40 ). Thank you for your input. Mike
November 22, 200817 yr Explode Strings / words... can work http://www.briandunning.com/cf/36 or http://www.briandunning.com/cf/586 you can use a wild card * to show all records just code that in to the key field in the related table. In your related table, create a calc field: cTitle: "*" & ExplodedString ( Title ) Then in your interface table (where your portal is) a global field where they enter the text. you can relate this to cTitle If you type in a * it should show ALL Records. if you type in a few letters it should filter. another option http://www.filemakermagazine.com/videos/power-filterting-for-portals.html
November 23, 200817 yr Author Hey Stephen: Thanks so much for pointing these out! Exactly what I was looking for. I tried Matt Petroysky’s solution, and it works really good, without the additional load of calculated data. As for the * and Matt’s solution, they don’t work together (at least not the way I tried it). But I’ve found another way out for this. Given are these fields: gSearchFieldStart (this is where the user keys in what he’s looking for) gSearchFieldEnd = gSearchFieldStart & "zzzz" (the user cannot see this field) and this self-relationship: gSearchFieldStart <= Title gSearchFieldEnd >= Title So, if the user enters ca he’ll find for example cat, as this lies between ca and cazzzz. What I found is that when you enter a letter followed by ¶ and then hit the Enter key, it returns all following records. So a¶ finds a list with all entries from a… to z… Thanks again, Mike
Create an account or sign in to comment