Unique number

G

Guest

I am very new at access, but I am trying to generate a unique anme/number
using the Last Name, First Name and autoNumber fields...by reading some of
the other posts, I have pieced together the following:

Private Sub strID_Enter()
If Me.NewRecord Then
Me.strID = Left([strLast], 3) & Left([strFirst], 2) & "00" & [autoNumber]
End If
End Sub

It seems to be working, but my question is if this is the best way to
generate a unique number/name. I guess I feel insecure about using
it...Should I keep the autoNumber field as the primary Key? Any advice is
much appreciated.
 
L

Larry Daugherty

Hi Kathy,

My advice is that you simply use the Autonumber field as the sole
primary key. I further recommend that you never let a user see that
autonumber key. If they see it, they might feel that they own it and
can control it. It obeys its own rules.

HTH
 

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

Top