copying data from one form to another (part 2)

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I want to copy records from my main form and 'paste' that data into a new
record/form. I am able to copy (thanks to Nikos) the controls from the main
form and 'paste' them into a new record/form.

But, how do I copy the fields from a subform? I think the biggest problem
with it is that there could be two fields in the subform or 20 depending on
what the product is that is being described.

Please let me know if you need more information.
Thanks,
Karen
 
This should probably be handled using query operations, not form
operations. This would involve:

1. Creating a new Product record.
2. Retrieving the Key for the new Product.
3. Copying the descriptor fields from the current Product to the new.
4. Requerying the subform with the new Product Key to show the copied
descriptor fields.

Step 1 could be a query or a form operation.
Step 2 follows the method of Step 1. If you use an Autonumber key, you
may find it easier to retreive using a form, but there are always ways
to retreive the key using a query.
Step 3 should definately be a query. Whether it is a parameter query or
custom SQL is up to you.
Step 4 uses the Key you retreived in Step 2.

This all assumes a two table setup: One that holds Product records, and
one that holds Descriptor fields for the Product, keyed by the Product
table key.

Hope this helps

-Ken
 
Back
Top