June 25, 200916 yr Is there a way to set a number field to always be equal to the value of the same field from the previous record..... plus an increment of 1? What I have in mind is something that produces a similar result to an auto-enter serial number. What I want to be able to do is delete a record in the middle of a list and have the number value for the next record adjust itself automatically to be equal to the new "previous" record. I hope this makes sense. Any ideas?
June 25, 200916 yr Take a look at the Auto Enter Options available for the Fields. In the Define Fields, Click on the Field to be serilized, click on Options, Auto Enter, Serial Number. Lee Edited June 25, 200916 yr by Guest
June 25, 200916 yr Is there a way to set a number field to always be equal to the value of the same field from the previous record..... plus an increment of 1? What I have in mind is something that produces a similar result to an auto-enter serial number. What I want to be able to do is delete a record in the middle of a list and have the number value for the next record adjust itself automatically to be equal to the new "previous" record. I hope this makes sense. Any ideas? Why do you want to do this? I suppose there are some reasons for it, but most of the time it is unnecessary. In a relational setup, changing ID numbers (especially if you are using them as the match field in the relationship) opens you up to a host of problems both now and as you get more data in the solution. For your ID fields, I would stick to the normal Auto-enter serial numbers that Lee mentioned. If you really need a field consecutively numbered, you can look at the Get(RecordNumber). But keep in mind that it is very dependent on the context of the found set. Changing the found set, and sort order I believe, will affect the number if gives you. Otherwise you could look at creating a list of numbers that you update as you create and delete records, to keep track of what is used and what is not. Kind of a transactional model of sorts. Edited June 25, 200916 yr by Guest
June 25, 200916 yr It's unclear what you're trying to accomplish, but an unstored calculation field = Get(RecordNumber) may be what you want.
June 25, 200916 yr Author Thanks guys for your help. FWIW: I include a serial number field on almost every database I write. As Lee suggested, I do this with an auto-enter, serial number option. For this particular application I am trying to serialize tasks for building processes in my cabinet shop. Usually the task list is developed proactively. In this case the auto enter serial number option works fine. Often times, however, someone will add a task on an adhoc basis. This task will either be something that we forgot or something we refined. In this case we still want the tasks to array sequentially (task 1 thru 10) but can't get there with just the serial number.
Create an account or sign in to comment