January 13, 20197 yr Greets, all: Is there a way to alphabetize values when using the List function? If you open the attached quick-'n'-dirty solution I'm building for my wife (Click a recipe [Multigrain...] then click VIEW button at top), you'll see the list of ingredients but I'd like them alphabetized. Note that the VIEW page will end up becoming printable, so no portals because they won't be able to self-expand to accommodate a long ingredients list. I'm sure the answer's simple...which is a good thing since I'm simple-minded, anyway. TIA for your help! Grace Recipes.fmp12
January 13, 20197 yr Actually, there are several possible answers to this: First, the List() function follows the sort order of the relationship - so if you sort the records on the Ingredients side of the relationship by the field listed by the List() function, the returned list will be in alphabetical order. Next, you have the SortValues() function, that you could apply to the list returned by the List() function. Before this function became available (in v.16), you could have defined a value list and use the ValueListItems() function to return the values in alphabetical order (with the side-effect of returning only unique values). However, the simple answer is to sort the portal. Yes, a portal is the best way to view related records. As for printing, print from a list layout of the Ingredients table, with the Recipe fields placed in the header, footer, grand summary and/or sub-summary parts. Edited January 14, 20197 yr by comment
January 14, 20197 yr Author Beauty! Thanks!! I didn't know that the List() function follows the sort order. Good to know! At first I created a value list of the calculated (Ingredient_Qty_Unit__lct) field and using ValueList Items(), but that picked up all the values and listed them for every recipe. Oops. So, either my thinking was wrong or I messed on the relationship. Edited January 14, 20197 yr by WF7A
January 14, 20197 yr 3 hours ago, WF7A said: I created a value list ... but that picked up all the values and listed them for every recipe. That's because you did not define the value list to include only related values.
January 14, 20197 yr Just out of curiosity: why would you want to alphabetize the ingredients? From the few recipes I've seen, I would expect the "important" ingredients to come first - e.g. if it's potato soup, then potatoes would be listed before pepper.
January 15, 20197 yr You're making the assumption that my wife has a logical mind. : D (I'm not being mean or insulting, she just doesn't.) Some of the ingredients are listed twice. I asked her about that: "That's because I use them two differnt times." "Why don't I go ahead and group the ingredients together for whatever you're making at the time, then?" *"The Wifoid" throws her hand out at me.* "Ai-yaaah." ...and that's what I live with. Love her to pieces, though. You noticed, too, that some of recipes are in Chinese (she's Chinese), so I have no idea how that's sorted. Edited January 15, 20197 yr by Rich
Create an account or sign in to comment