copying data from subform to subform

S

Simon

on a form i have 2 subforms which are both datasheets.

I would like a button on the form that i click and will then copy the
data from one subform to another

i have created a buttton with On click
Forms![frmManufacturePartsUsed]!ProductCode") =
Forms![frmManufactureParts]!ProductCode")

but this did not work


Can any one tell me how to do it


Thanks
 
J

John Vinson

on a form i have 2 subforms which are both datasheets.

I would like a button on the form that i click and will then copy the
data from one subform to another

i have created a buttton with On click
Forms![frmManufacturePartsUsed]!ProductCode") =
Forms![frmManufactureParts]!ProductCode")

but this did not work


Can any one tell me how to do it


Thanks

Several things here.

The data is NOT stored in your Subforms. It's stored in Tables. The
forms/subforms are *just windows*.

Secondly, storing the same data in two different tables is BAD DESIGN.
It's not clear just what you want copied. I'd suggest - if it's
appropriate to copy the data at all - that you use an Append query to
append a new record into the table upon which frmManufacturePartsUsed
is based.

Finally, to reference a Subform you must navigate through the mainform
upon which the subform appears. A subform is not part of the Forms
collection. The syntax uses the Name property of the Subform Control,
which may be (but need not be!) the same as the name of the Form
object within that control:

Forms![MainFormName]![frmManufacturePartsUsed].Form![ProductCode]

for example.

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