Forum Discussion

RalfLuijten's avatar
RalfLuijten
Qrew Member
4 years ago

Initialize Form Field with Max + 1 of a particular column

Hi.

I have a table called Foo, with a numeric field called Nr.

When creating a new Foo via form, I want the input box for Nr to be initialized with the maximum of all current Foo.Nr's plus one.

Is this possible, and how? This should only work for the "add" mode of the form, not the "edit" mode.

Thanks.

1 Reply

  • You will need to have a table that is a parent to the 'Foo' table. This will allow you to do a Summary field on the Nr field. You can then create a button to Add a New Foo record and within that button, you would pass the Summary value +1 to the Nr field. It sounds like you're trying to create something to generate the next in line to the Nr value (a consecutive number). If that's the case, I would recommend against this particular setup and suggest the possibility of doing a calculation that would be based on the Record ID# instead. This would eliminate any possible errors if records are deleted in the future.



    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------