Autonumber edit

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Is there any way to edit an autonumber field after the
entry has been made?

Thanks in advance,

Jason
 
Jason said:
Is there any way to edit an autonumber field after the
entry has been made?

No.

If you think you have a good reason for editing an
AutoNumber field, then you should not be using AutoNumber.

An AutoNumber primary key is only guaranteed to be unique
and could be any random value (even text if you use
replication). Autonumbers should never be exposed to users,
since they have no meaning beyond their use as a surrogate
key.
 
What I really want is a number field that increments from
the last record. There will only be one user entering in
data to this table, so not really any issues with sharing
here. What's the best way to make this type of field?

Jason
 
In case anyone else is looking, here's a KB article to
answer the question:

Microsoft Knowledge Base Article - 306128
 
Oh, you just want an incrementing number field, not really
an AutoNumber field. In that case, I think that article is
unnecessarily complex. You don't need a query to find the
maximum value in the table, you can just use DMax instead
DLookup on a Totals query.

Instead of using the Current event, it's better to use the
form's BeforeInsert event to set the field's value:

Me.fieldname = DMax("fieldname", "table") + 1

The Insert events only fire on new records so you don't need
to check for Me.NewRecord
 
Back
Top