How do I delete the ID box?

  • Thread starter Thread starter JAS
  • Start date Start date
When you create a new table in Access 2007, it automatically gives you an ID
field because you really should have one. You can rename it later to
something like CustomerID, or whatever you wanted.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 
boblarson said:
When you create a new table in Access 2007, it automatically gives
you an ID field because you really should have one. You can rename
it later to something like CustomerID, or whatever you wanted.

Really? Does it only do that if you didn't define a PK? Older versions at
least asked you if you wanted Access to add an autonumber PK when you didn't
define a PK yourself.
 
Yes, really - if you select CREATE > TABLE, it automatically gives you an
autonumber field (PK) as Autonumber. If you select CREATE > TABLE DESIGN it
does not.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 
boblarson said:
Yes, really - if you select CREATE > TABLE, it automatically gives
you an autonumber field (PK) as Autonumber. If you select CREATE >
TABLE DESIGN it does not.

I take it you mean that horrible datasheet method of creating a table. I
have never used that.
 
Since it is an autonumber, you can't.

UNLESS, you delete all the records in the table and then compact the database
(at least in earlier versions).

There really is no reason to do this. An autonumber is designed to generate a
unique number and will not be sequential with no breaks unless you never
delete a record and never start to enter a record and cancel the entry.

If you need a sequential number that will not have breaks in it, you will need
to code a routine to create the number for you. AND you will need to enter
every record through a form to ensure the routine runs and numbers the records
appropriately.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
No, that is not the way it works. The number increments for each record
that is started. If you cancel the record, the number is still used.
If you delete a record, the number has been used and will not (under
normal circumstances) ever be used again.

If you need a unique sequential number without gaps, you will need VBA
code to create the number.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Oh, okay, I guess I misunderstood exactly what the id is used for, it just
seemed to me if I have a list of customers that list should start with 1
(being the first number in the key) and continuing 2,3,4...etc.
 
Oh, okay, I guess I misunderstood exactly what the id is used for, it just
seemed to me if I have a list of customers that list should start with 1
(being the first number in the key) and continuing 2,3,4...etc.

Sure.

Suppose you have 3122 customers entered. You review the data and find that
customers 1 and 2 weren't really customers, but test records. You delete them.

Should the other 3120 customers' ID numbers be instantly changed? How about
all the related tables, all the printouts, all the mailed invoices...? If you
don't change them all, you're stuck with a gap in the numbering.
 
Back
Top