PC Review


Reply
Thread Tools Rate Thread

Duplicating records

 
 
alex
Guest
Posts: n/a
 
      28th Jan 2011
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.
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      28th Jan 2011
On Fri, 28 Jan 2011 08:50:56 -0800 (PST), alex <(E-Mail Removed)> wrote:

>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/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
alex
Guest
Posts: n/a
 
      29th Jan 2011
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





On Jan 28, 6:01*pm, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> On Fri, 28 Jan 2011 08:50:56 -0800 (PST), alex <alex....@hotmail.co.uk> wrote:
> >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/For...-US/accessdev/
> *http://social.answers.microsoft.com/.../en-US/addbuz/
> *and see alsohttp://www.utteraccess.com- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      29th Jan 2011
On Fri, 28 Jan 2011 16:09:29 -0800 (PST), alex <(E-Mail Removed)> wrote:

>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/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: To find duplicate records in a query that is already finding duplicating records Allen Browne Microsoft Access Queries 3 13th Nov 2008 03:17 AM
Duplicating Records Please Help! =?Utf-8?B?Sw==?= Microsoft Access VBA Modules 2 13th Mar 2006 02:19 AM
duplicating records =?Utf-8?B?U3VlUg==?= Microsoft Access Forms 0 10th Mar 2005 08:43 PM
duplicating records =?Utf-8?B?SmFzb24=?= Microsoft Access Getting Started 0 3rd Jun 2004 01:21 AM
Duplicating Records Brian Hauf Microsoft Access Getting Started 1 3rd Jun 2004 01:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:00 PM.