Duplicate a subform

C

Confused Slug

Re: Duplicate the information held in a form and the subform and pasteappend
into a new record.

I wish to duplicate the information held on one form and paste it into a new
form (record) I am using the code below to perform this action ok. However,
the form contains a subForm and i would like this information to be
duplicated at the same time as the main form and pasted into the new record.
How would i code this?


Private Sub DuplicateRecordButton_Click()
On Error GoTo Err_DuplicateRecordButton_Click


DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteApend

Exit_DuplicateRecordButton_Click:
Exit Sub

Err_DuplicateRecordButton_Click:
MsgBox Err.Description
Resume Exit_DuplicateRecordButton_Click

End Sub




Thanks
Confused
 
J

Jeff Boyce

I believe I understand what you are trying to do, but why?

If you already have the data, why duplicate it? Generally, in a
well-normalized relational database, you DON'T duplicate data.

Regards

Jeff Boyce
Microsoft Access MVP
 
C

Confused Slug

The main form / table contains details such as company name, address, ICNO
terms etc from who a quotation for a list of parts has been requested. The
list of parts is contained in the sub form. This is done so that each record
in the main for is linked to a number of records in the subform. If a
quotation is required from another company for the same parts then i am
duplicating the main form information over in to a new record to avoid having
the fill out the fields (with the exception of the company details which is
different) and then to avoid re enetering the list of parts in the sub form i
would like the information to copy over at the same time. The list of parts
will not be 100% identical but it is more practicle to copy all of the
details over and then delete / amend where necessary.
 
J

Jeff Boyce

I guess I'm still not visualizing your situation.

It sounds like you have information about a company from which you are
requesting a quote.

Then you want to get a quote from another company, but want to keep the same
information (except company info) for that other company.

What "other information"? Please provide an example of something that you'd
want/need to copy over to a new record.

Regards

Jeff Boyce
Microsoft Access MVP
 
C

Confused Slug

hJeff

Correct. When i wish to get a quote from another company i wish to duplicate
the information and append to a new record.

I have a main form on which all the company specific information is entered
and a subform in data sheet format which 'lists' all the various items, batch
sizes, target prices etc.

The problem is that i need to pasteappend the subform information along with
the main form information. As this list is on a subform it does not
pasteappend with the main form data to the new record.

The data in the subform is not selected from a list or other data source. It
is typed in as the number and type of items in nearly infinite ( ranging from
toilet paper, stationary and thousands of parts + plus any thing else you can
think of required by business).
 
J

Jeff Boyce

Sorry, but I'm going to have to step back and hope another newsgroup reader
can help. I'm just not seeing it...

Good luck!


Regards

Jeff Boyce
Microsoft Access MVP
 
O

ouattara

Confused Slug said:
hJeff

Correct. When i wish to get a quote from another company i wish to
duplicate
the information and append to a new record.

I have a main form on which all the company specific information is
entered
and a subform in data sheet format which 'lists' all the various items,
batch
sizes, target prices etc.

The problem is that i need to pasteappend the subform information along
with
the main form information. As this list is on a subform it does not
pasteappend with the main form data to the new record.

The data in the subform is not selected from a list or other data source.
It
is typed in as the number and type of items in nearly infinite ( ranging
from
toilet paper, stationary and thousands of parts + plus any thing else you
can
think of required by business).
 

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