Uniquie Field numbers skipping ahead

Discussions for the HanDBase for iPad and it's conduits and desktop add-ons

Uniquie Field numbers skipping ahead

Postby jerryg » Thu Apr 30, 2015 5:03 pm

The first field on the database called RecordNumber which is a "unique" field. I use this for invoice numbers. It usually is an auto increment of 1 number for each record. However, Several numbers are randomly missing. I found the number skips if you create a new record and quickly hit cancel. If you wait several seconds before cancelling it just creates a blank record as expected. I am using Handbase on iPad with Forms.
jerryg
 
Posts: 1
Joined: Thu Apr 30, 2015 4:47 pm

Re: Uniquie Field numbers skipping ahead

Postby Brian_Houghton » Sat May 02, 2015 8:29 am

Hi,

Thanks for posting.

The unique field type is what we refer to as a legacy field type, as it is prone to issues, specifically the one you are experiencing. HanDBase uses an internal unique counter, but various factors can cause the value assigned to a new record to be nonsequential.

If you are wanting a way to count records, I encourage using a calculated field that adds 1 to the previous value of itself.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Uniquie Field numbers skipping ahead

Postby mjhanna » Sat May 02, 2015 5:30 pm

Hi Jerry,

Sounds like you are trying to generate a unique "Record Number" for each of your records. As Brian noted, HanDBase's "unique" field type is probably not a good candidate for doing something like this. Brian also suggested "using a calculated field that adds 1 to the previous value of itself". This would work if you want to count the records, but may not be what you are trying to do.

I think HanDBase can do what you want, but the method is somewhat advanced, and there are pitfalls. I suggest you read the Forum thread about "Automatically generating a Unique, Static, "Key" field" which I started here some time back. Be sure to read the entire thread as Dave and Brian both replied with some warnings and issues concerning the method I describe. However, if you understand those warnings I think it might be a way to create your unique "Record Number" for each of your records.

Hope this gives you ideas,
Michael
(Only a user and not affiliated with DDH Software, but working with computer databases for over fifty years.)
mjhanna
 
Posts: 155
Joined: Tue Oct 15, 2013 10:56 am
Location: New Mexico


Return to HanDBase for iPad

Who is online

Users browsing this forum: No registered users and 1 guest

cron