4 Replies Latest reply on Mar 26, 2013 7:17 AM by philmodjunk

    Inserting a record into database in the middle not end?

    heraldst

      Title

      Inserting a record into database in the middle not end?

      Post

           I was wondering if there is a way of inserting a record not at the end of my database, but in the middle somehow?

           I have my database sorted by record number which matches up to an inventory number I have assigned, so record number 1 is inventory number 1, etc.  

           A record was mistakenly deleted in the middle of my database which has made all the subsequent records out of synch.  

           Is there a way to re-insert this record in it's original place in the record order without changing the way records are sorted?  It's important to keep my inventory number in synch with my record numbers. 

           Thank you!

        • 1. Re: Inserting a record into database in the middle not end?
          JimMac

               I think you mean RecordID, generated by FMP when it was created. Get (RecordID )

               If so....

               I don't know of a way to change that, since FMP uses it internally for various options.

               Otherwise Record Number as  Get (RecordNumber ) changes for each sorted found set.

               You can create your own duplicated field [MyRecordID] equal to FMP RecordID at creation and then assign your field with any  corrected MyRecordID  if one was accidently corrected.

               Jim....

          • 2. Re: Inserting a record into database in the middle not end?
            heraldst

                 Thanks, Jim.  

                 I'm referring to the Record Number.  I've accidentally deleted record number 3697 which means all my own inventory numbers are out of synch. I was wondering if there is a way to re-insert this entry at 3697 rather than at the very end of my database.  Does that make senes?

            • 3. Re: Inserting a record into database in the middle not end?
              JimMac

                   Yes it makes sense but sorting is the only way to assure that, and a very unstable way to match records, as you have found out.

                   But...

                   Simply put a value in the New record to Replace the lost record so that it will sort to the Lost position in  your found set.

                   Jim...

                   PS: Record Number is variable based on Found Set and Sorting.  In other words,  you CAN"T sort on Get (RecordNumber) per se.

              • 4. Re: Inserting a record into database in the middle not end?
                philmodjunk

                     If it is out of synch with a number field, create a new record and enter the desired number into that field. If this field is set to auto-enter serial numbers, you can open up Manage | Database | Fields and reset the next serial value so that the next record created doesn't create a new gap.