help with my recovered database

G

Guest

My database went corrupt and we were able to recover the data but the
autonumber in the ID field is changed to number and i can't put it back on
number and i need it on autonumber because its got all connecting records

I then tried to put the primary key back on as number and it doesn't allow
because it says it will create duplicate values, but how can this be if i had
it on autonumber until now

I think this is causing me not to be able to edit fields in a form and
subform connected by the customer iD
 
A

Allen Browne

To fix your table:

1. In the Database window, select this table, copy and paste.
Answer "Structure Only", and supply a new name for the table.

2. Open the new table in design view, and delete the Number field.
Save.
Put a new AutoNumber in the table, using the same name (if you wish.)
Save.
Close.

3. Create a query into the original table.
Change it to an Append query (Append on query menu).
Answer to append the records to the new table created in step 2.
Drag all the fields into the grid.
Run the query.
Access appends the existing records to the new table, including the values
into the autonumber field.
(No need to save this query.)

4.Choose Relationships on the Tools menu.
Delete all relationships from the old table.
Close the Relationships window. (Answer Yes to "save?")

5. Delete the old table (after verifying the records are in the new table.)

6. Compact the database: Tools | Database | Compact.

7. Open the Relationships window, and create the same relationships on the
new table that you deleted at step 4.
 

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