Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 9th, 2004, 04:07 PM
Authorized User
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need to dup a whole record in a data entry form

Is there an easy way to duplicate a whole record when entering data in a data entry form? I know I can use Ctrl ' to dup a field, but I want to dup the whole record. Is there a way to do this?

Thank you for your help!

Mark J. Weisberger
Mark J. Weisberger
Old June 9th, 2004, 08:52 PM
sal sal is offline
Friend of Wrox
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts

A whole record means a record containing the Primary key, which should be unique. This restriction will keep you from "duplicating the entire record".

What exactly are you trying to do? Please define duplicate.

Old June 10th, 2004, 01:35 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts

There's a wizard function that does what you want.

Open your form in Design View
Make sure you have the wizards turned
Put a command button on the form.

Choose "Record Operations"
then "Duplicate Record"
That will end up with this code:
On Error GoTo Err_Command1_Click

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Command1_Click


I am a loud man with a very large hat. This means I am in charge
Old June 10th, 2004, 09:02 AM
Authorized User
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts


Kudos to you Steven and to the person at Microsoft who wrote the code.

Life is good.

Mark J. Weisberger
Old August 29th, 2005, 10:09 AM
Registered User
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Trying to append a record that has an index with a unique ID? I'm using the 'Duplicate' button. I'd tried modifing it with ... Me.Record_Number = Me.Record_Number + "-new" ... But that doesn't work.

Appreciate the help.


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to display record number in data entry form markw707 Access 5 August 28th, 2014 12:08 PM
Check for Duplicate Records in Data Entry Form roznix Access VBA 5 June 7th, 2012 08:53 AM
The best way to design a data entry web form cesemj ASP.NET 2.0 Basics 2 November 5th, 2007 02:44 PM
New Record Data entry one form lgpatterson Classic ASP Basics 1 February 8th, 2005 12:58 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.