|
||||||
|
|
Create a Duplicate Record By Richard Rost Create a Duplicate of an Existing Record in Access Sometimes you want to make a duplicate copy of a record. Perhaps you're entering products and you have two products are very similar except for a few details. You can duplicate the record and just change the different fields. This video will teach you how to do it with a single click. New VersionThere is a new version of this video available here: MembersThere is no Extended Cut for this video. LinksIf you want to duplicate a record that has related child records, such as an Order with Order Details, then you'll need some VBA programming. I cover this in Access Developer 24.
IntroIn this video, I will show you how to create a button to quickly duplicate a record in your Microsoft Access form using the built-in command button wizard. We will walk through the process step by step, from adding the button to your form to naming it and confirming that it works. I will also explain when this simple approach is useful, and mention what to do if the control wizard does not appear when you add your button.TranscriptWelcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor Richard Rost. Today's lesson is going to be short and sweet. It is about duplicating a record - how you can duplicate a record in one of your forms with just a single click.Today's question comes from Tanya. She says, "I need a button that can duplicate, copy, an entire record into a new record. My original database had a button to duplicate records, but it's corrupt now and doesn't work." I am assuming you have tried a compact and repair. The most common reason we used it was to duplicate a product or project page, where everything would be the same except for one or two fields at the same time, and kept data consistent. Yes, I can definitely see where you would find this useful. I have a couple of buttons like this in my database. One for my blog entries, for example, where I have a certain layout and a template where I can click a button. It makes a copy of it, then I just fill in new details and put a new title in it, but it saves all the formatting and the layout. And yes, I am a nerd. I keep my blog entries in a database, of course. Now, funny story. It has been so long since I have done the basic beginner level classes that I forgot all about a simple feature that will make this job a two-second insert into your form. I was trying to think of all kinds of advanced developer ways to do this with VBA, with SQL, with macros. I forgot there is a simple command button wizard to duplicate a record, and here is how you use it. Open up a form like your customer form. Let's say you want to duplicate this. Let's say you have someone else from the same company, same family, whatever - you just want to change their first name, but you want a separate record. Right-click, go to design view. Bring up the design ribbon here. Go to controls, find the command button, and drop it anywhere on your form. Go to record operations, duplicate record. Next, picture or text - I usually use text. Next, give the button a meaningful name, "DoDuplicateRecord" or whatever you want to call it, and then finish. There is your button. That is really all you have to do. It is that simple. Save it, close it, reopen it. Here is Richard Rost, record 105. Watch this - hit duplicate record. Notice I am customer ID one. Boom. Now I am customer ID seven. Now you can just make your changes. That is it. That is all you have to do - duplicate record button. The trick is if this has related records you need to copy, like for example if you had customers with contacts and you wanted to copy that information, that would require a little bit more than just this simple duplicate button. If anyone wants to see how to do that, let me know and I can put that in one of my classes, because that is going to involve either some macros or some SQL or something a little more advanced than just a single button. But for one record at a time, this will work just fine. Oh, and before I sign off, because I know someone is going to ask, if the wizard does not run when you drop the button on your form, go to your toolbox and make sure that your control wizards are active. "Use control wizards" should be selected. That is it. Thanks. I hope you learned something. That was a quick and simple TechHelp. Again, it has been so long since I have used those command button wizards because I preach in my classes, "Don't use the wizards," because I prefer teaching people how to write VBA. So I forgot all about it. I went back and looked in all of my course outlines from previous classes and I have never covered it. So this is a good thing. If you are watching me on YouTube, make sure you click on the subscribe button and ring the bell so you get notifications when I release new videos. If you are watching me on my website, make sure you subscribe to my Access forum. Submit your questions to me via my TechHelp page, or you can email me. There is all the fun stuff - blog, Facebook, Twitter, blah, blah, blah. Free Access Level 1 three-hour class. If you want to learn the basics of Access, there you go. There is the link. I will put it in the description below the video. If you like level one, there is a link for level two for one dollar. Thanks and I hope you learned something. QuizQ1. What is the main topic of this TechHelp video?A. Creating tables in Access B. Duplicating a record in an Access form C. Formatting reports in Access D. Writing SQL queries in Access Q2. What common use case does Richard mention for duplicating records? A. Importing data from Excel B. Copying an entire table C. Making a new record with similar data for projects or products D. Backing up your entire database Q3. What is the easiest method for duplicating a record, according to the video? A. Using a VBA script B. Writing a custom macro C. Using the command button wizard's duplicate record function D. Exporting and re-importing the data Q4. Where should you go in your form to start adding a duplicate record button? A. Form view B. Print preview C. Design view D. Datasheet view Q5. In the command button wizard, after choosing "Record Operations", what should you select to duplicate a record? A. Delete Record B. Save Record C. Duplicate Record D. New Record Q6. What is the purpose of giving your button a meaningful name like "DoDuplicateRecord"? A. To make code easier to read and manage B. It is required by Access C. It increases database performance D. To assign specific formatting Q7. What should you check if the command button wizard does not start when adding a button? A. Make sure "Allow Edits" is set to Yes B. Ensure "Use Control Wizards" is selected in the toolbox C. Enable database encryption D. Restart your computer Q8. What limitation is mentioned for duplicating records with related (child) records? A. The button always copies related records automatically B. It does not copy related records without more advanced tools like macros or SQL C. It exports the related data instead D. It can only duplicate one related table at a time Q9. According to the video, what does Richard usually teach in his classes instead of using wizards? A. Custom database templates B. VBA (Visual Basic for Applications) programming C. Only using macros D. Relying on manual data entry Q10. What free resource does Richard mention for learning Access basics? A. A three-hour Level 1 class B. A YouTube playlist on forms C. A downloadable PDF manual D. Free one-on-one tutoring Answers: 1-B; 2-C; 3-C; 4-C; 5-C; 6-A; 7-B; 8-B; 9-B; 10-A DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks. SummaryToday's video from Access Learning Zone focuses on how to duplicate a record in a Microsoft Access form using a simple, built-in feature. This lesson addresses a common request I receive from students: the ability to quickly copy an entire record to create a new one with minimal effort.The question came from a student named Tanya, who explained that her old database had a button for duplicating records, but it became corrupted and stopped working. She wanted a way to recreate that functionality to efficiently produce new records that are nearly identical to existing ones, updating only a few fields as necessary. Duplicating records in this way can be very helpful. In my own databases, I use a similar feature, especially with my blog entry templates. By copying the layout and formatting, I only need to change the necessary details, which helps keep my data consistent and saves a lot of time. While there are more complex ways to duplicate records using VBA, SQL, or macros, I was reminded of a much easier method that Access provides. The command button wizard, available right in the form design tools, allows you to add a duplicate record button in just a few seconds. Here is how to add this feature to your form: Open your form in design view. For example, you might use your customer form if you often need to duplicate customer data. From the design ribbon, select the command button control and place it on your form. In the button wizard, choose the option for record operations and then select "duplicate record." You can choose to display text or an image on the button. I recommend giving the button a clear name such as "DoDuplicateRecord" to describe its function. Complete the wizard and your button will be ready to use. Once that is done, save your form and reopen it. When you are viewing a record and press the new duplicate record button, Access will instantly create a new record with all the data from the current one already filled in. For example, if you are viewing yourself as customer ID one, pressing the button will create a new entry, perhaps as customer ID seven, containing all the same information. You can then make the necessary changes to your new record. If your database includes related records that need to be duplicated along with the main record, such as customers with multiple contacts, this wizard alone will not handle those. Duplicating related records will require more advanced techniques involving macros or SQL. If there is interest in learning how to do that, let me know, and I can cover it in a future lesson. One important note: if the wizard does not appear when you add a command button, make sure the "Use control wizards" option is enabled in your toolbox. This ensures the wizard guides you through setting up the button correctly. I hope you found this quick lesson useful. It is a simple trick that I realized I had not covered before, even though it can be incredibly efficient for many common Access tasks. Usually, I recommend learning VBA for more power and flexibility, but sometimes the built-in tools are exactly what you need. If you would like more information or step-by-step guidance, you can find a complete video tutorial that walks through everything we covered here on my website at the link below. Live long and prosper, my friends. Topic ListAdding a duplicate record button to a form using the command button wizardUsing the design view to edit forms in Access Placing a command button on a form Choosing the Duplicate Record action in the command button wizard Naming and customizing the duplicate record button Testing the duplicate record button functionality Enabling control wizards if the wizard does not appear |
||||||||||||||||||||
|
| |||
| Keywords: TechHelp Access Create a Duplicate Copy of a Record command button wizard duplicate record PermaLink Create a Duplicate Record in Microsoft Access |