Use Manage | Database | Fields to change the field type to text.
Replace field contents could be used with this expression to convert existing return separated years into a comma separated list:
Substitute ( Yourtable::field ; ¶ ; ", " )
Replace Field contents will update every record in your found set and cannot be undone. It's a good idea to save a back up copy of your file before using this tool to modify your data.
My drop-down list comes from a value list of numbers 2000 to 2020. If I make the calculation you suggest, only the first number from the drop-down list appears, with no comma following.
Correct. I assumed that you wanted to reformat the data in the field, not the drop down list.
Can you explain in more detail what you want to do here?
I want to format the data in the drop-down list field, not the value list.
If the entries in the drop-down list shows 2000 only, then that's what should show in the new field. If the drop-down list shows
I want it to show 2000, 2012, 2014.
Then what I have described, will do exactly that.
But if the field used with the drop down list is also the source of values for your value list, this will also affect what values you see in the drop down list of values. If that's the case, you'll need to choose a way to keep the source of values for your value list separate from this calculation that takes the return separated list and produces a comma separated list. That could be as simple as adding a calculation field that uses the substitute function to get a list of years separated by commas, but keeping your drop down list field unchanged.
Note: It's possible to hide the drop down list field behind the calculation field such that you click on the visible field and get the drop down list, but after selecting a value, the list disappears and you see the calculation field placed in front of it with commas separating the multiple values.
Thank you for your reply. I'm unclear on your instructions. The drop-down list field shows the values from the value list. All values are shown, and the user needs to select the value or values (which represent years) needed. I did make 2 calculation fields, but the way I did it isn't the ideal way. I first made fields to correspond to each year (e.g. GetRepetition (MEMBERSHIP YEARS ; 15), and from that calculation, I was able to get a list of all years listed. I know that there has to be an easier and more professional way, but the calculation you indicated above didn't work.
You'll need to describe what you have set up in much more detail. Get Repetition implies that you are using a repeating field. Is that the case here?
The calculation does work if the multiple values are all in the same field--which would be the case with a non-repeating field that has multiple values in it, but not necessarily the case with a repeating field with one year in each repetition.
I had assumed that you were selecting multiple years in the same field by holding down either the shift or control key will selecting multiple years from the drop down list. That can insert multiple values into the same field separated by a return character. This now appears to be an incorrect assumption.
My drop-down list is a repeating field (19 repeats).
The use of a repeating field--something originally used back in the flat file versions of FileMaker prior to version 3,is rarely the optimum design choice to use in current versions of FileMaker.
But this modification of the original calculation should work according to FileMaker Help:
Substitute ( List ( YourRepeatingFieldHEre ) ; ¶ ; ", " )
Brilliant, as always! Thank you very much -- it works like a charm.