I cancelled by mistake the n1 record of primary key and now I cannot activate the related table..... can someone help me please!
I cancelled by mistake the n1 record of primary key and now I cannot activate the related table..... can someone help me please!
Did not have cascade delete in relationship so you have orphan records now?
Is the primary key field an autonumber type? It is possible to use an INSERT sql action to create this record with the deleted primary key value. Then must run Compact & Repair on the db to reset the PK seed value.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Hi June7! Tnx a lot! I'm not an expert... how should I do to INSERT sql?
Hi June7! Tnx a lot! I'm not an expert... how should I do to INSERT sql?
I use VBA, can even do this in the VBA immediate window. Suggest you test on a copy of the db.
CurrentDb.Execute "INSERT INTO tablename (your pk field) VALUES (the missing number)"
Or build a query object with that SQL.
However, if any other fields are set as Required, this will fail. You will have to include those other fields in the SQL with appropriate values.
CurrentDb.Execute "INSERT INTO tablename (your pk field, atextfield, adatefield, anumberfield) VALUES (the missing pk, "sometext", #somedate#, number)"
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks a lot! I will try.....