Button to copy and paste a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an inventory-tracking database that I'm putting
together with 2000. I need to find a way to add a button
that will do the following at a sub form: (1) Select the
last record in the sub form (2) Copy the record (3) go to
a new record in the sub form and (4) paste the copied
record as a new record.

I'm hoping this can be done with a macro. If I can find a
way to do this I'll be able to create a database that the
end users will accept without resistance. Seeing the large
amount of info being put into this each day having them
right click to copy and paste each record is not what they
want to do
 
Copy/Paste is not really a suitable approach to this type of situation,
whether it be manually or with a macro. You should use an Append Query.
If you want to use a macro to run the Append when the button is
clicked, use the OpenQuery macro action. (After you're sure you have it
working correctly, you might also want to put a SetWarnings,No action in
the macro before the OpenQuery, to suppress the display of the action
query confirmation messages.)
 
Hello Steve:

Thank you for the reply. I just have a question about how
I would go about having the append query copy only one
record at a time instead of copying each record.

Thank you
Robert
 
Robert,

You would use a reference to the record you want to duplicate in the
criteria of the query. If you are replicating the current record on the
form, the query criteria could look like this...
[Forms]![NameOfYourForm]![NameOfYourKeyField]
Otherwise you will need some other means of identifying the record you
want to use.
 
Back
Top