Copying fields on a form to a new record/same form

Cath_W

New member
Local time
Today, 12:04
Joined
Jul 10, 2008
Messages
2
Hi All,

Can anyone help me with the coding required please?

I have a Customer table for various areas of council. It is possible that I can have another customer at the same address and council. Is there a way of having a Copy button on the form, that when pressed will:
1/ Create a new record on Customer copying all details from the current form except name and phone details
2/ Have this new record's content replace that on the current form with the new record id current.

Thanks
 
Hi,

If you create a button on your form and follow the wizard there is an option to create a duplicate record. Therefore, once you click on the button a new record is created and all you have to do is to replace the name and phone details for your new record.
 
Yes,

I have the exact same thing on my db.

the way I did it was by using an append query, with the record ID criteria pointing to what is open on your form, and only including fields you want to keep.

eg. to keep the value.

field = address1
table = Yourtablename
Appendto = address1

eg, to have the current on screen record duplicated

field = recordid
table = yourtablename
Appendto =
Criteria = [forms]![yourformname]![recordid]

Now, you just need to call the query from a button on your form.

docmd.openquery "yourqueryname"
 

Users who are viewing this thread

Back
Top Bottom