How to copy over previously-assigned GUIDs to Autogenerate field? (1 Viewer)

transliminal

New member
Local time
Today, 13:22
Joined
Sep 27, 2019
Messages
4
Hi there,

I have some data to import from an excel file in which the primary key is in GUID ('Replication ID') format.

I want to convert the excel sheet into a table in Access that will keep generating unique GUIDs for future records.

I'm having trouble, because it seems an Autogenerate field cannot accept copy-pasted data, even if they're both in GUID/Replication ID format.

Any solutions?

Cheers,
 

June7

AWF VIP
Local time
Today, 12:22
Joined
Mar 9, 2014
Messages
5,466
It is possible to use INSERT action SQL to enter specific values into Access autonumber field. Example:

CurrentDb.Execute "INSERT INTO Rates(ID, Rate) SELECT ID, Rate FROM SourceData"

Run Compact & Repair afterwards.

Excel doesn't have field types so what do you mean by "GUID"?
 

Micron

AWF VIP
Local time
Today, 16:22
Joined
Oct 20, 2018
Messages
3,478
Consider having a normal autonumber ID field and use the GUID from Excel as a unique index. If the data is coming from Excel, there's no reason to have an Access table field with the same number type as the Primary Key.

You don't say what Access version you're using. AFAIK, nothing after 2010 can use replication, so now may be the time to use some other PK data type.
 

Users who are viewing this thread

Top Bottom