'Paste Errors' table created when copying and appending

dtru

New Member
Joined
Apr 15, 2004
Messages
2
This is an MS Access2000 question:

when copying and appending a record to the same table while in a form using the following code--

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend

I am getting this error message--

'Records that Microsoft Access was unable to paste have been inserted into a new table called 'Paste Errors'

anybody know what's going on here??
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Here's a broad question.
What are you trying to do and why?

Here's why I'm asking:

Generally, you do not use the methods you've chosen to append records.
Also, Access tends to not like it when you use the same table as the source/destination for results. In fact, I'm completely confused why you'd wish to do that at all. What you're attempting to use sounds an awful lot like what you'd have to do within Excel.

As a basic technique suggestion:

If you're trying to create new records...what you might do is:
1) Create your main table(s)
2) Copy the main table and use the copy as a 'temporary' table
3) Create a form that uses the 'temporary' table as it's recordsource
4) When ready to update the main database, use an Append query to Insert the records created in the temporary table to the Main table.
5) After Appending, delete everything in the temporary table.

The fun thing about this is, an append query uses SQL. SQL doesn't require that you specify to append 1 or 5000 records in a single action.

Try this out:

Create a table with data:
Go to the query view and begin using the QBE (query by example wizard interface) and go ahead and select everything in the first table. Save it.
Reopen it in design mode and then change it to a 'Make-Table' query (menu or buttons at top of Access). Type in a brand new table name at the prompt. Run it.

You now have two identical tables.

Return to your (now) Make Table query in design mode. Remove a couple fields. Save and Re-execute. Now the table has fewer fields (the ones you didn't delete)

Finally - purge all the contents in the 2nd table (open table, select all - tap delete key on keyboard works well). Return to your Make-Table query. Convert it to an append query. It shouldn't prompt you for a new table name. Because your field names are identical Access will "guess" that you intend to bring over the field names to the same name in the 2nd table.

Run it - it should look identical but its actually an 'Append' query.

Lastly - after saving the query. Reopen it in design mode and set a parameter. In the criteria row, under one of the fields (string or number work best for reasons best unexplained at the moment for clarity) - type in a value that matches only a few of the records in the test table. Aka, if you have 10 entries, 3 of which are all the same thing ("hi") type in the word "hi"). If you're cleared the destination table - and re-run this query, your destination table will only append those three records with a matching value.

What I'm really getting at with all this commentary is the strength behind using Access. SQL (queries use SQL) and how easy it actually is using the Wizard interfaces to build them so they do a lot of work for you, quickly.

Mike
 
Upvote 0
thanks for the reply Mike.

I guess I should have explained further what my intent was with that question I posted.
That copy/append task I am trying to do is attached to a table, which is the record source for a form.

In this form, users are supposed to enter new records as necessary.
Let's say there are approximately 100 fields which are part of this form (source is the table). I wanted to set up a button which would allow the user to copy an existing record and then edit it while they are in the form. The purpose of this is so that the user does not have to re-enter every single field for a new record if this new record has the same info as an existing record. If 90 of the fields are the same and only 10 fields are new, then the user needs to only update 10 fields instead of 100 fields.
That is what I want to do is copy an existing record and append, and then allow the user to update this record in the form right away before they save it to the table.

That code was generated when I set up the button using the wizard to 'duplicate record'. And the error is what happens when I try to execute it.

Is there an easy way to do this?
 
Upvote 0
Oops, guess that makes me some wacko with a few lines of code.
Thanks for letting me know the source - would you believe I've never needed to duplicate a record and so never tried that particular option?

Not sure why I'm so blessed as to have missed it.

I'd have to answer - mostly because I've never worked with that particular problem and I'm honestly *swamped* at the moment that I'm not sure.
I'm hoping one of the other posters around here has some thoughts.

Mike
 
Upvote 0
Is this even possible in Access? You'd think it would be easy to accomplish, but, alas, all programs have their limitations.
 
Upvote 0

Forum statistics

Threads
1,221,683
Messages
6,161,264
Members
451,692
Latest member
jmaskin

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