I would like to set the initial value of a fo...

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?

0 8 937
8 REPLIES 8

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!

Top Labels in this Space