I am new to Access. So I have one Excel linked table in Access "Surge Arrester" which is unmodifiable and can only be modified in Excel. I want to copy the keys from the "Surge Arrester" in the field "ID/IDS" into a new table called "Surge Arrester internal" to the field, also called, "ID/IDS". I really don't understand how I can do this. Nothing I tried worked. I tried this: But nothing happens to the Surge Arrester Field internal ID/IDS field, it remains empty: The data is there, in the Excel linked table. Considerations: -the data in the Surge Arrester is unmodifiable since it's a linked table. -I want to use those keys to create a new table that I can do all sorts of stuff to, like appending other fields, etc. -Chat gpt is dumb and can't tell me why is not working. -I am a newbie in using access or any kind of databases. -I used this tutorial, and everywhere I look I see the same method. ;t=153s
What is happening and why it's not working as intended?
I am new to Access. So I have one Excel linked table in Access "Surge Arrester" which is unmodifiable and can only be modified in Excel. I want to copy the keys from the "Surge Arrester" in the field "ID/IDS" into a new table called "Surge Arrester internal" to the field, also called, "ID/IDS". I really don't understand how I can do this. Nothing I tried worked. I tried this: But nothing happens to the Surge Arrester Field internal ID/IDS field, it remains empty: The data is there, in the Excel linked table. Considerations: -the data in the Surge Arrester is unmodifiable since it's a linked table. -I want to use those keys to create a new table that I can do all sorts of stuff to, like appending other fields, etc. -Chat gpt is dumb and can't tell me why is not working. -I am a newbie in using access or any kind of databases. -I used this tutorial, and everywhere I look I see the same method. https://www.youtube/watch?v=iIberC3EpnE&t=153s
What is happening and why it's not working as intended?
Well, then you will have to do several things:
Update existing records
UPDATE [Surge Arrester internal] SAI
INNER JOIN [Surge Arrester] SA
ON SAI.[ID/IDS] = SA.[ID/IDS]
SET SAI.Caracteristic = SA.Caracteristica
Insert missing records
INSERT INTO [Surge Arrester internal] ([ID/IDS], Caracteristic)
SELECT [ID/IDS], Caracteristica
FROM [Surge Arrester] SA
WHERE SA.[ID/IDS] NOT IN (SELECT [ID/IDS] FROM [Surge Arrester internal])
Delete extra records (optional)
DELETE * FROM [Surge Arrester internal]
WHERE [ID/IDS] NOT IN (SELECT [ID/IDS] FROM [Surge Arrester])
Identifiers (table and column names) with spaces and special characters like "/" are not great when writing queries. They require you to put them in square brackets. The underline character "_" is a good replacement for these problematic characters.
First, as you do, link the Excel file.
Next, create a simple select query having the linked Excel table as source. In this query:
Save the query.
Finally, use this query as source in a combined update and append query, that will insert new records in your destination table and modify those (if any) that exist in the table. Here is how to build such a query:
Update and Append Records with One Query