Duplicating records

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

I hope someone can help me, I have a main form and a sub-form which
allows me to create a main group and add as many parts within that
group via the sub form as required. Each form is connected to a
seperate table but with a relationship set to link both sets of data
via a unique reference.

I need the option of being able to duplicate the complete main group
AND contents and then be able to edit 1 of the existing fields on the
newly created main group record.

I can easily duplicate the main group by using the duplicate record
option command but cannot work out how to get the attached data to
copy over in 1 operation at the press of a button or run of a query. I
have tried append query with no avail - is this is best/only way of
doing this?

Any help would be greatly appreciated.

Thanks
Alex.
 
I hope someone can help me, I have a main form and a sub-form which
allows me to create a main group and add as many parts within that
group via the sub form as required. Each form is connected to a
seperate table but with a relationship set to link both sets of data
via a unique reference.

I need the option of being able to duplicate the complete main group
AND contents and then be able to edit 1 of the existing fields on the
newly created main group record.

I can easily duplicate the main group by using the duplicate record
option command but cannot work out how to get the attached data to
copy over in 1 operation at the press of a button or run of a query. I
have tried append query with no avail - is this is best/only way of
doing this?

Any help would be greatly appreciated.

Thanks
Alex.

An append query would indeed be the correct approach. What have you tried?
Could you post the SQL? What caused it to fail?
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
Hi John,

I found the error shortly after the post went live.
After a hard day, I had tried to append an existing autonumber field
into another one to force duplicates and kept getting violation
errors.
Silly mistake I know, but all is working well now.

I have used the duplicate record command to copy the initial group and
then run an append query to add the associated data to the new group
with a little bit of manipulation of certain fields

Thanks
Dave
 
Hi John,

I found the error shortly after the post went live.
After a hard day, I had tried to append an existing autonumber field
into another one to force duplicates and kept getting violation
errors.
Silly mistake I know, but all is working well now.

I have used the duplicate record command to copy the initial group and
then run an append query to add the associated data to the new group
with a little bit of manipulation of certain fields

Glad it's working!

For the lurkers: if you want to run an Append query and have new autonumbers
assigned you must include all the fields EXCEPT for the Autonumber.

You can run an append query appending values to an autonumber field - it's the
only way to put a selected value into an autonumber, in fact - but this will
fail if the autonumber is a Primary Key and if running the query would cause a
duplicate.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
Back
Top