cadillac
08-15-2001, 04:02 PM
i would like to be able to duplicate the record that was last entered into a form. i want to be able to do this x (user entered) number of times. i just want to take the last record in the table and copy it x number of times. i know i shouldn't duplicate identical records, but it's only for lables.
thanks
Abby N
08-16-2001, 06:25 AM
The easiest way I've found to do this is to code a command button that moves to the last record then sets the default values of the fields you'd like to duplicate equal to the current record. From there it should be a simple matter to create x number of records. If you need help with the code let me know and I’ll send you a sample.
[This message has been edited by Abby N (edited 08-16-2001).]
cadillac
08-16-2001, 12:14 PM
please do send me an example. i think i follow you, but i don't know the code to reference the record.
Abby N
08-17-2001, 05:37 AM
Just sent it off. If you have any questions just let me know. BTW, I wasn't sure what version of Access you're running. So, I created it in 97. But, it should work fine in 2000 as well. Hope it helps.
One more thing, the sub I created creates duplicates of the current record. I figured it would be more flexable that way. If you only want to duplicate the last record add this line of code to the beginning of the sub.
DoCmd.GoToRecord , , acLast
~Abby
[This message has been edited by Abby N (edited 08-17-2001).]
houdragon
09-16-2001, 06:40 PM
please do send me an example on how to duplicate previous record.
Thanks