Copying and pasting a record

G

Guest

I have a form which I will be entering over 12,000 records in. I would like
to know if I enter a duplicate of a previous record. So as the identifier of
the record I have used a combo box with the autoexpand and autofill set to
yes, which searches well. What I would like is to be able to do is select an
item in the combo box and have the form automatically copy all data from the
selected record, open a new record, and paste all the data to it. Can this be
done?
 
T

tjandt

I have a similar question

I frequently have the need to enter the same data into 25 to 50 ne
records a week

What I was wondering is if there's a way to be on the current record
and be able to have a command button on screen that says 'copy recor
to new' or somesuch, and on the on click event, have it copy th
contents of the current record, and paste them into a new record.

Ultimately, I'd like to be able to have a text box next to it with
number, and it would copy that number of new records wtih teh sam
data into my table

I'm thinking some kind of loop with an append query type of SQ
statement

Thanks
Ti
 
T

tjandt

Doh, silly me, creating a duplicate record is covered with wizards fo
the CMD button in my version of Access

To resolve your issue Ben, you'd want to attach the following code t
the after update event of your combo box

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer7
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer7
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Past
Appen

In my case, I needed to add a bunch of records at once, so I made
text box with integer input named txtCount, and on the on click eve
of my duplicate record command button, did the following

Dim x As Intege
For x = 1 To Me.txtCoun

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer7
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer7
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Past
Appen

Next

[/code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top