Adding Autonumber Field

  • Thread starter Thread starter Kim
  • Start date Start date
K

Kim

I already have a database set up, but now am finding a
need to add an autonumber field to an existing table that
already contains data. Access won't let me do this. I
need this because I am trying to create a Find Record
Control on a form - the table contains a multiple primary
key and I need the "Find" to pull based on both fields.
I thought by adding the autonumber field I could solve my
problem. Any suggestions? Thanks
 
Backup your database
Create a new table with all the fields you need, plus an autonumber field.
Create an append query to pull all the data from the old table to the new
one.
Delete the old table - which is why you have a backup !
Rename the new table to the old table name
Re-establish any relationships to the new table.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
the table contains a multiple primary
key and I need the "Find" to pull based on both fields.
I thought by adding the autonumber field I could solve my
problem. Any suggestions? Thanks

I have to say that I don't see how it could solve your problems. If you
need to search on two fields, that is easy enough:

WHERE Location="Glasgow" AND Course="X509" AND MatricYear=2003

or whatever. It is simple to build this into a SQL command or a DLookup
function. Note that the same construct can be used in the Filter for a form
so that the user only has access to the record he or she requested.

That is what a Primary Key is for: to identify one particular record in a
whole table. I don't really see how your "find" feature could be made
easier by adding a new candidate key into the picture.

All the best


Tim F
 
Back
Top