Jump to content
Sign in to follow this  
MariaAux

Repeating Fields ?

Recommended Posts

I have been using FM for a few years, and I have always seen repeating fields loitering around but never used them. I am creating a a printable envelope whereby the user enters the starting months and the remaining 11 months of the year appear on the envelope in order ready for printing.

I thought this might be a good time to have one field that produces all 11 months in order instead of 11 other fields with calculations. But somehow, I just can't get any good instruction videos or explanations on 'Repeating fields'. Would this be an appropriate time to use them? How on earth would I acheive what I have set out to with 'Repeating Fileds?... or should I just stick with 11 other fields?

Thanks so much in advance.

Share this post


Link to post
Share on other sites

the user enters the starting months and the remaining 11 months of the year appear

An example would be useful, I think.

Share this post


Link to post
Share on other sites

Yes an example would be great. However I think use of repeating fields should be limited in their, use.. they definatly have their place but I personally do not use them to store data.. I use repeating fields to show data on some reports, even use them as a kinda switch for containers in a portal when I want to show only specific keyword items.

Share this post


Link to post
Share on other sites

Thanks for the quick reply. My example is as simple as this. I have crated a field called 'Starting Month'. The user enters the starting month name into this field.

The second field could be called 'Remaining 11 months' and would list the remaining 11 months in order beginning with the month name immediately after the first month.

I.e. the user enters;

September

and the field below it fills in;

October

Novemeber

December

etc...

or am I barling up the wrong tree here?

Thanks so much

Share this post


Link to post
Share on other sites

This is a great application for repeating fields. Create a global date field, STARTDATE, to store any date in the starting month for users to enter. Then make a calculation field with a return type of date and 12 repetitions. Define the calculation as:

Let ( [

~date = Extend ( STARTDATE )

];

Date (

Month ( ~date ) + Get ( CalculationRepetitionNumber ) - 1;

1;

Year ( ~date )

)

)

... in summary, the contents of the repeating field will be the first date in each of the next 12 months. When you put this repeating field on the layout, select the field and go to the date formatting options at the bottom of the "Data" pane on the Inspector palette. For the format, select "Custom" and configure it to only display the month portion of the date.

Share this post


Link to post
Share on other sites

A repeating calculation field would be ideal for this.

However, first you need to make Filemaker understand the meaning of the string "September". There are several ways to approach this - the simplest one would probably be to have a value list of all MonthNames (this would also ensure users do not misspell their entry), then use GetValue() to retrieve the corresponding items from the same value list.

Share this post


Link to post
Share on other sites

You're a Genius Jeremy! Works like a charm, I am going through it now to understand the inner workings of it. Greatly appreciated.

Thanks so much and have yourself a splendid weekend,

Maria

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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