Appending data from a transferred excel spreadsheet

Data

New Member
Joined
Sep 13, 2004
Messages
2
I have transferred data from excel into a temporary table using a macro built into a form. This form should call up 4 fields, "autonumber", "Display Number", "Display Cost", and "Assembly Cost" from a separate permanent table after an append query is run. The Temporary table contains all of the fields except "autonumber". The Permanent Table has all four fields. Each time the transfering of the data is done from excel to the DB, the old data is deleted from the temp. table via a delete query. My problem is within the append query. I can't get it to append only the most current record specified in the form. Within the query, I have tried using criteria such as "[Forms]![Name of my Form]![autonumber]", but the error I keep getting is that the query couldn't append the values because of a "key violation". I hope all of this made sense to someone, if it doesn't well... (y)
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Is the Autonumber field actually of Autonumber data type?

Is it the primary key of the Permanent table?

If it is you can't append to it as it is automatically created. Do you actually want to keep the autonumbers from the Excel spreadsheet?

If you do then you'll have to change the data type of the autonumber field.
 
Upvote 0

Forum statistics

Threads
1,221,828
Messages
6,162,213
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top