Re: Copy Record within Same Table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: tina (nospam_at_address.com)
Date: 04/09/04


Date: Fri, 09 Apr 2004 03:26:42 GMT

okay, i'll resist comment... <g>

if you can write a Select query to pull the records you want to duplicate,
then turn the query into an Append query and append the record(s) back to
the same table. this won't work if the duplicate record violates a primary
key or unique index field in the table. on the other hand, depending on how
you're coming up with values to update those certain fields (that you
mentioned below) in the "new" record, you may be able to insert those values
into the new record(s) at append time - killing two birds with one stone, so
to speak.

hth

"vseale" <anonymous@discussions.microsoft.com> wrote in message
news:1a4e401c41dda$cfa01f30$a301280a@phx.gbl...
> I know(!), but I have a legitimate need to copy an
> existing record within a table and I don't believe
> openrecordset.clone or AddNew are the most efficient way
> to do it. I have 90 fields and don't want to
> use .AddNew. All the examples I've found use
> Openrecordset.clone within a form that the user controls,
> I don't see how to apply it to an automated process. The
> records are programmatically pulled in when a PDA is
> hotsynced. After it copies the outside file into a table,
> I want to loop through it and duplicate any record that
> has two fields containing values (barcode1 and/or
> barcode1). The new record will then have certain fields
> updated to make it unique. (I've got this part of the
> code working.) Any help on this is greatly appreciated.



Relevant Pages

  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... I have many many queries that check for orpaned data (for example, if there's a billing record with no matching custID in the customer table, I'm putting up a form with the unmatched data, and a quick way to update all unmatched to one archive type customer, etc. ... I was surprised to see duplicate entries in some of the static tables for dropdown selections, so I have to solve this one now. ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ...
    (comp.databases.ms-access)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... I'm calling a function that will set the occurence number. ... If there's a duplicate, ... I used the query wizard to create a "find duplicates" query, now I need to adjust the results of that query to add an occurence counter/number, and I'd be set. ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ...
    (comp.databases.ms-access)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... After playing around with duplicates, and a funtion to generate an occurence number, it looked like you would need a handful of queries per table!! ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ... On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? ...
    (comp.databases.ms-access)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ... On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? ... 2nd problem, and this is a biggie, maybe a showstopper for my import utility: When running a series of update queries to update data from one database to another, I use a docmd.setwarnings false statement before running each update or append query. ...
    (comp.databases.ms-access)
  • Re: Membership database updates
    ... When you open any Query in Design View, click on the toolbar just next to ... black down-arrow where you can change your query to an Append or Update ... If you have any current members in your Import list, ... You mention Update Queries and Append Queries but I can't find how to ...
    (microsoft.public.access.tablesdbdesign)