Connecting Tech Pros Worldwide Help | Site Map

Copy data from forms via relationships....

david@scene-double.co.uk
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi,

I have an Access app which has data for our product range set-up as
follows:

Main Form: General Product Data
Sub Form (within Main Form): Low Level Data
Buttons on main form linking to other related data for the current
product.

I am trying to create an additional system where I can copy all the
data & related data for a selected product to a new product record and
then just change various elements such as Name, Cost etc. This would
save an enourmous amount of time in re-typing each individual element
of each product when similar custom products are required.

Is this facility possible, and if so how. I know how to copy a straight
recordset, but not with sub form & related data all at the same time,
whilst creating new record ID's etc.

Appreciate your help



David

pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Copy data from forms via relationships....


Umm... if you have an autonumber PK, this could be hard. You'd have to
run the insert, grab the returned primary key, then pass that to the
"insert child records" routine, which would mean you'd have to run the
insert in a function in code, and then the new PK would be returned as
the function's return value. then you'd pass that value to your second
(child record) insert as the foreign key (or one of them - depends on
how your tables are set up.)

Perhaps someone else here has some better ideas, as I'm sure this is
not the best way to do it.

Closed Thread