I would like to set the initial value of a form to be the previously entered value+1.
The column is called [Trainingplanday]. So Iโm putting [Trainingplanday]+1 in this columns โInitial Valueโ field (see image).
I know this expression works because it works in other columns. But it wonโt work in itโs own column. I should say that this column type is โRefโ. I expect that is what is stopping it. Is there any work around?
What is the error message or behavior you are seeing with it?
It just defaults to the normal drop down list
If you donโt have that date in that ref column (values for the dropdown), it wonโt show it as initial value. Can that be the reason?
I donโt quite understand what youโre saying but I donโt think so. [Trainingplanday] is a number (currently between 1-5), which represents the day of my training plan. Oddly, I can put any other column name as the Initial value for [Trainingplanday] and it works just fine. It just seems to have a problem referring to itself. Maybe when youโve set the column to โRefโ it stops being able to read itโs own value (because itโs now linked to a column in another table?)
When you said โpreviously entered valueโ, do you mean another record than this one?
Hi Aleksi, I think you are onto something with your question. What I want to do - at the most simple level - is use the form to insert a number, and then the next time I use the form for that number to be the โinitial valueโ of the same field. So if I enter โ5โ, then the next time I use the form it should have 5 in that field. If I enter 6, it should be 6. What happens at the moment is that โinitial valueโ field keeps showing โ5โ. Itโs like it puts the new row at the bottom of the table but โreadsโ the tops row. How can I make it read the newest row?
First you would need to read the last recordโs key columnโs value with the MAXROW expression. Then you could read the last trainingplanday value with the formula [MaxRowColumn].[TrainingPlanDay].
Yes! 'Thatโs exactly what I needed. For anyone following this thread there is a demo app called โMost recent valueโ that demos exactly what I was trying to do using โMaxrowโ. Thanks very much for persevering Aleksi!
User | Count |
---|---|
16 | |
10 | |
9 | |
8 | |
3 |