philou54 Posted June 21, 2007 Posted June 21, 2007 Hi everyone, I'm kind of stuck here. I'm trying to create a dynamic value list with an autoincrement number field. E.g: Field number: 20 Value list: 1,2 ..... to 20 I can't manage to do that with a calculation field because I can't use a "loop" fonction because this is not a script. Is it possible to do that? Thanks a lot!
Fitch Posted June 21, 2007 Posted June 21, 2007 What do you mean, "Field number: 20"? Twenty fields on your layout? Twenty records in your found set?
philou54 Posted June 21, 2007 Author Posted June 21, 2007 I mean, I set the number "20", and then it makes a calculation and display in a value list the numbers 1 to 20. Then if I change the number field to "13", it does the calculation from 1 to 13, and display it in a value list. I hope you understand
comment Posted June 21, 2007 Posted June 21, 2007 Since you have Advanced, you could do this using a custom function. But it is simpler to use a repeating calculation field = Let ( i = Get ( CalculationRepetitionNumber ) ; Case ( i ≤ Extend ( yourNumberField ) ; i ) ) You will need a self-join relationship based on SerialID (or another unique field) to use this as a value list.
philou54 Posted June 21, 2007 Author Posted June 21, 2007 Thanks raybaudi! it works and it's exactly what I needed.
Raybaudi Posted June 21, 2007 Posted June 21, 2007 Remember to follow comment's suggestion about the self-join relationship ! So this file is better... DynamicList.zip
philou54 Posted June 21, 2007 Author Posted June 21, 2007 I have an other problem. I need to create a new record with this calculation "1" for the first, "2" for the second record etc... When this number is reached, I need it to start over from 1. For example I put "4" in field "number" Records: 1->1, 2->2, 3->3, 4->4, 5->1, 6->2... etc Do you know how to do that? Reset the "extend" fonction maybe?
Raybaudi Posted June 21, 2007 Posted June 21, 2007 ...but this is a totally new question ? or the field "number" is the same of the previous question ?
comment Posted June 21, 2007 Posted June 21, 2007 That is going to be difficult, because the number "4" needs to in a global field - and a calculation referencing a global field cannot be used to build a value list. You could create a separate table as a bank of values, and define a ≥ relationship to it. Then use the related values for the value list.
Raybaudi Posted June 21, 2007 Posted June 21, 2007 If the field "number" contains always the same value for all records of your DB, you can add a calculated field ( say "custom" ) with this calc: Case( Mod ( id ; number ) ; Mod ( id ; number ) ; number )
Raybaudi Posted June 21, 2007 Posted June 21, 2007 Id is a field that auto-enter the serial number on creation of the record, like the one of my second attachment
philou54 Posted June 21, 2007 Author Posted June 21, 2007 I tried with the "Mod" fonction but I can't see the aim of the use of this fonction
Recommended Posts
This topic is 6726 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 accountSign in
Already have an account? Sign in here.
Sign In Now