Re: update/apphend Fkey on Import -
01-24-2011
, 08:20 AM
Well, we lack quite a bit of information about table structure.
In general, I would import the data into a work table (or set a link to the
Excel "table" and then use an append query to add new records to the table
(SomeLocationTable0 that contains the values for location and name.
INSERT INTO [SomeLocationTable] ([Name],[Location])
SELECT Temp.Name, Temp.Location
FROM WorkTable as Temp LEFT JOIN [SomeLocationTable]
ON Temp.Name = [SomeLocationTable].Name
AND Temp.Location = SomeLocationTable.Location
WHERE SomeLocationTable.Name is Null
This assumes the the Primary Key in SomeLocationTable is autogenerated (it is
an autonumber).
Then after the above runs you import the records from the WorkTable into your
destination table.
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
On 1/23/2011 7:49 AM, flebber wrote:
> name and location |