Jump to content
Server Maintenance This Week. ×

Alphabetize values using List function


This topic is 1928 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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 by comment
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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 by WF7A
Link to comment
Share on other sites

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 by Rich
Link to comment
Share on other sites

This topic is 1928 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.