unique record numbers

  • Thread starter Rev David Bissas
  • Start date
R

Rev David Bissas

I am trying to create a unique PIN for members in a table (not the primary
key) that will be 4 digits long, and would like each new entry to be
incremental. I am very new, and would appreciate a detailed instruction
(though I can get around access fair enough). Any help would be appreciated.
 
T

Tom van Stiphout

On Fri, 5 Mar 2010 19:19:44 -0800, Rev David Bissas <Rev David
(e-mail address removed)> wrote:

The "DMax + 1" technique should work for you. Google or Bing for it.

-Tom.
Microsoft Access MVP
 
S

Steve

PINs are suppose to be confidential and no one is suppose to know anyone
else's PIN. This being the case, why would the PINs need to be incremental?
You're just making it hard on yourself. Just use an autonumber starting at
some appropriate four digit number. If you should skip a number, so what!

Steve
(e-mail address removed)
 
J

Jeff Boyce

Steve offers a cogent point. If your PINs are sequential, and if I have a
PIN, what's to stop me from trying out the number before and after mine?

Are you confident that folks wont be able to use brute force to try all
10,000 possibilities? Are you confident you'll never have 10,000 PINs to
generate?

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
A

accessnewbie79915

I am new to access myself, but I do know enough to say that if you adopt the
autonumber setup it would work better for you. However, do not skip numbers
when building your database. The reason for this is that when it comes time
to query your data into reports and forms, if you skip numbers it could cause
problems pulling in the data that you want.
 
J

Jeff Boyce

Depending on your definition of "autonumber"...

If you mean what Access provides, we can almost guarantee there will be
"skipped" numbers.

If you mean a custom "autonumber" (lower case) function, it could ensure
that numbers are guaranteed sequential ... BUT! if someone were to delete a
record, there would still be a missing/skipped number!

Good luck

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top