copying data from subform to subform

S

Simon

I know what i am doing is bad practice as its duplicating data but
there is a reason why i am duplicating it, but its hard to expain


I have a form with two datasheet subforms
There will be data in the top subformform (frmManufactureParts) and i
want to copy it to the botton subfform (frmManufacturePartsUsed)

I want a o click button the the form to do the copy

i currently have the following code

frmManufacturePartsUsed.Form!ProductCode =
frmManufactureParts.Form!IDNumber
frmManufacturePartsUsed.Form!Quantity =
frmManufactureParts.Form!Quantity

This coe only copys the bottom line of data from the datasheet.

Is there a way to make it copy all the data


Thanks
 
J

John Vinson

I have a form with two datasheet subforms
There will be data in the top subformform (frmManufactureParts) and i
want to copy it to the botton subfform (frmManufacturePartsUsed)

I want a o click button the the form to do the copy

i currently have the following code

frmManufacturePartsUsed.Form!ProductCode =
frmManufactureParts.Form!IDNumber
frmManufacturePartsUsed.Form!Quantity =
frmManufactureParts.Form!Quantity

This coe only copys the bottom line of data from the datasheet.

Is there a way to make it copy all the data

Yes.

STOP THINKING ABOUT FORMS.

Forms don't contain data. They *display* the data in tables.

If you want to copy data from the ManufactureParts table to the
ManufacturePartsUsed table (and, subsequently, display that data in
your Form) then the proper technique is to use an Append Query based
on the ManufactureParts table, appending to the ManufacturePartsUsed
table.

This Query can have criteria based on your main form to copy only
those records being displayed on the subform - I don't know what those
criteria would be, since I can't see your database, but they'd be the
same as the subform's Master/Child Link Field.

John W. Vinson[MVP]
 

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