Macro to create a duplicate record

kuebs

New member
Local time
Today, 17:08
Joined
Mar 6, 2002
Messages
5
I want to create a button that has a macro that will make a duplicate of the last record, and then the user can change one or two items? This is to save them a lot of data entry. Is this possible? I would use VBA also if that helps.
 
If your entire form is being duplicated except for a few fields, I wonder if your data structure is designed correctly. Is it possible you can split some of this off into lookup tables and the like?

Anyway, search the archives for 'duplicate record code' and you'll find several solutions for both VBA (preferred) and macros (changing the last word, obviously).

There's also a button for 'Duplicate Record' under 'Record Operations' in the Command Button wizard.

HTH,
David R
 
You can use a SetValue to this in a macro. For instance if you want to bring the LastName filed from the current record to the new record you would do it like this.

macro.gif


You can do as many SetValues as you want in one macro. I would encourage you to do this in code instead of macros like this:

Code:
With CodeContextObject
   .LastName.DefaultValue = """" & .LastName & """"
End With
 

Users who are viewing this thread

Back
Top Bottom